I’m posting to a users Facebook wall with code similar to this:
[appDelegate.facebook requestWithGraphPath:@"me/feed"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
If I dismiss the hosting UIViewController before the request completes, I get a crash when the request does actually complete because the delegate has been dealloc’d.
There’s a good description of the problem I’m facing here: https://github.com/facebook/facebook-ios-sdk/issues/220
- (void)dealloc {
appDelegate.facebook.sessionDelegate = nil;
[super dealloc];
}
This does not work!
I had a solution for that but not very convenient;
I am having 2 separate views in the same view controller, where one of them is the one you request the publish the other the destination view.
You just hide one of the views when request is finished. Or hide the other and display the one while requesting.
For example if you are going to another page after logging in :
The idea is like that, it works but not very convenient.