I have included facebook ios sdk in my application. When I first did this, it was connected to my ViewController class ONLY. So it worked just like a demo. He also worked. I was able to post everything, etc. My app delegate has the correct url file to connect in it etc.
The problem arose when I changed my application to have a different main screen, and on the last screen there is information about connecting to facebook. So now my App Delegate has a function:
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
SocialView *socialView = [[SocialView alloc] init];
return [[socialView facebook] handleOpenURL:url];
}
Because of this change, my variable is facebook
always null
on return from login and didLogin is never called. I assume this is because every time it returns a view, it is recreated, and also facebook var is replaced.
What is the solution? Thanks for any help ...
-d
Edit: It is worth noting that if I had only one view:
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [[viewController facebook] handleOpenURL:url];
}
works great.
source
share