Troubles with SFS2X on osX

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Troubles with SFS2X on osX

Postby eugenofarm » 07 Nov 2017, 10:40

Hello.
We have a good experience with SFS2X for IOS in objectiveC language.
Now I would like to use it for mac OS application in swift

I follow the official docs
I use xcode 8.3.3 and macOS Sierra 10.12

- download the official frameworks 1.7.3
- create a swift macOS project
- add SFS2XAPIOSX.framework to the project (check to create a copy)
- Select the CFNetwork.framework from the list and click Add.
- Select the QuartzCore.framework from the list and click Add
- Select the Security.framework from the list and click Add
Image


- add -lz and -ObjC

Image

- add Bridge file

Image
Image


On RUN it gives 3 errors
/Users/nataliazlatin/Desktop/IOS_WORKS/2017/CompanyOrganizer/SFS2XAPIIOS.framework/Headers/UserVariable.h:19:4: error: expected a type
- (BOOL) isPrivate;

Image
Image

There is no much information about SFS2X for swift and I would like to ask if is it possible to use it?
And how to solve this errors on running.
Thanks
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 07 Nov 2017, 11:42

Another thing is when I want to create a project with objectiveC and SFS2x
do the same steps with API integration
It is running well but crash immediately
Image

I search on google and try to add SFS2XAPIOSX.framework in Embedded binaries but error didn't disappear

Image

strange it doesn't run at all
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Troubles with SFS2X on osX

Postby Lapo » 07 Nov 2017, 15:29

Hi,
I think the 2nd problem is a library loading issue (as per the error logs in your screenshot)
If I remember correctly OSX is a bit stubborn with library loading and will look for your libraries under ~/Library/Frameworks.

Try copying the SFS2X OSX framework there and run it again. It should solve the problem.

As regards the first issue, I am downloading XCode 8.3.3 (4.5GB) and will get back to you after I have tested.

Stay tuned.
Lapo
--
gotoAndPlay()
...addicted to flash games
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 07 Nov 2017, 15:38

Hi, thanks for your reply
On the second problem I copied SFS framework in folder project ,and even in xcode Library/Frameworks
:( Clean and run. Not help
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 07 Nov 2017, 15:47

I create even a Directory Library/Frameworks :(

Image
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Troubles with SFS2X on osX

Postby Lapo » 07 Nov 2017, 16:38

Wait... the folder already exists and it is located under your User directory.
As I wrote about it is --> ~/Library/Frameworks where the ~ (tilde) sign means your User folder.

For example my user name is "Lapo" therefore the folder is located under /Users/Lapo/Library/Frameworks/

One extra question.
In the first issue you mention Mac OSX but you are importing the IOS API ... so I am confused as to which kind of project you're running.

Can you clarify?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 08 Nov 2017, 07:37

Sorry, You are right. I create and osX project and insert SFS2XAPIOSX.framework
Image
Same errors
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 08 Nov 2017, 07:48

ObjectiveC

There no such folder User/MyMacUser/Library/Frameworks

But there is a mac/Libary/Frameworks and I put it there and it works :) at least in objectiveC

lets hope that this will work even for Swift
I will report later
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 08 Nov 2017, 08:00

unfortunately in swift it event doesn't run because of errors in compiling
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Troubles with SFS2X on osX

Postby Lapo » 08 Nov 2017, 08:26

eugenofarm wrote:ObjectiveC

There no such folder User/MyMacUser/Library/Frameworks

But there is a mac/Libary/Frameworks and I put it there and it works :) at least in objectiveC

lets hope that this will work even for Swift
I will report later

It is actually under /Users/ not /User
I am running OSX 10.11 so maybe something is changed in Sierra but I doubt it, since those folders have been there for a very long time.
At any rate copying in it under the top level /Library folder works the same, of course. It's just that usually requires admin privileges to copy stuff, while your user's Library doesn't.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 08 Nov 2017, 08:50

Thanks
Can you check why in swift id doesn't run
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Troubles with SFS2X on osX

Postby Lapo » 08 Nov 2017, 09:57

Yes,
I have have checked under XCode 8.2 (8.3 doesn't run on El Capitan, which is my OS at the moment) and there are no issues.
At this address you can download the test project.

Please try it on your side.
Before running the test, copy the SFS2XOSXAPI.framework file to --> /Library/Frameworks/
( Copy it, do not move the file )

Then open the project, compile and run.

If there're still problems, tell us what errors do you see.
Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
eugenofarm
Posts: 17
Joined: 12 Jan 2016, 15:56

Re: Troubles with SFS2X on osX

Postby eugenofarm » 08 Nov 2017, 12:53

Thanks for your help and fast answers.
It work very well
I think the problem is that I didn't insert
#import <Foundation/Foundation.h>

#import <CFNetwork/CFNetwork.h>
#import <QuartzCore/QuartzCore.h>
#import <Security/Security.h>
in bridge file

Good job (Y)
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Troubles with SFS2X on osX

Postby Lapo » 08 Nov 2017, 14:38

Great!
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Troubles with SFS2X on osX

Postby Lapo » 08 Nov 2017, 15:40

p.s. = we added in the docs the extra steps regarding the Swift bridging header and a note regarding the need to copy the SFS2X under /Library/Frameworks for OSX.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 6 guests