Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Facebook Xcode Error?

So I went to Facebook developers site to integrate Facebook SDK. I followed the instructions on how to integrate the Facebook SDK and create my app. I set up a URL Scheme & added a Facebook app id to the info.plist in the FacebookAppID key.

So anyways, When I finished doing those set of instructions I tried running the app on the simulator & ran into an error: 'No visible @interface for 'FBAccessTokenData' declares the sector 'userID'

Error with these lines of code:

+ (BOOL)userHasValidFacebookData:(PFUser *)user { // Check that PFUser has valid fbid that matches current FBSessions userId NSString *facebookId = [user objectForKey:kPAPUserFacebookIDKey]; return (facebookId && facebookId.length > 0 && [facebookId isEqualToString:[[[PFFacebookUtils session] accessTokenData] userID]]);

Are you sure that this is right?

[[[PFFacebookUtils session] accessTokenData] userID]]

because it is complaining about that whatever is returned here [[PFFacebookUtils session] accessTokenData] doesn't have property or method called userID

Well.... I think accessTokenData is somehow deprecated, but I can't seem to figure it out. I looked on Facebook developer's website & here's a link that will probably help, but I still can't understand it.

It's under access tokens

[https://developers.facebook.com/docs/facebook-login/ios/v2.4]

Stepan Ulyanin

Wait are you using Parse to integrate?

Yes, sorry, I forgot to mention that. I'm actually using one of parses projects called Anypic in Github. I followed all of the instructions on the README file & I got an error in the PAPUtility.m file.

[https://github.com/ParsePlatform/Anypic]

'No visible interface for FBAccessTokenData declared the selector userID'

+ (BOOL)userHasValidFacebookData:(PFUser *)user { // Check that PFUser has valid fbid that matches current FBSessions userId NSString *facebookId = [user objectForKey:kPAPUserFacebookIDKey]; return (facebookId && facebookId.length > 0 && [facebookId isEqualToString:[[[PFFacebookUtils session] accessTokenData] userID]]);

Stepan Ulyanin

I will look into the problem, but why haven't you used the original facebook SDK? https://developers.facebook.com/docs/facebook-login/ios/v2.4 It is easier to use and better documented

I did. But I didn't think I would run into any errors considering the fact its source code from Parse. It wouldn't make sense that the app would be crashing due to an error in their code.

and thanks! It would really help!

Stepan Ulyanin