问题
Using Facebook iOS SDK 3.7, Xcode 4.6, iOS simulator 6.0.
Here is my code:
NSLog (@"opening session");
[FBSession openActiveSessionWithPublishPermissions: @[@"publish_actions"]
defaultAudience: FBSessionDefaultAudienceFriends
allowLoginUI: YES
completionHandler: nil];
NSLog (@"open active session completed");
if ([FBSession activeSession].isOpen)
{
NSLog (@"initiating feed dialog");
[FBWebDialogs presentFeedDialogModallyWithSession: nil
parameters: nil
handler: nil];
}
When executed, it crashes with the following output to the debug console:
opening session
open active session completed
initiating feed dialog
-[FBDialog initWithURL:params:isViewInvisible:frictionlessSettings:delegate:]: unrecognized selector sent to instance 0xb93c7e0
I tried several variations, they all crash; the variation above is the simplest.
Thanks very much for any help.
回答1:
The problem was that legacy code elsewhere in the system (an old version of the ShareKit library) was colliding with the Facebook SDK. When I removed the legacy code, then the code in the question above worked properly.
来源:https://stackoverflow.com/questions/18345283/facebook-ios-sdk-presentfeeddialogmodallywithsession-crashes