我正在尝试为iOS设置Facebook SDK 3.5。我已经成功地让它工作了,但现在它崩溃了。只有当用户通过默认的iOS Facebook设置(即不是从应用商店下载的Facebook应用程序)登录时,崩溃才会发生。应用程序特别在点击Facebook“登录”视图时崩溃。
崩溃信息是:error: [NSError fberrorShouldNotifyUser]: unrecognized selector sent to instance.
我已经做了一些研究,有些人建议将-Objc放入“其他链接器标志”。我没有确切的方法,但我想我有类似的东西。我需要其他选项来支持其他库。以下是我的选项:
崩溃信息是:error: [NSError fberrorShouldNotifyUser]: unrecognized selector sent to instance.
我已经做了一些研究,有些人建议将-Objc放入“其他链接器标志”。我没有确切的方法,但我想我有类似的东西。我需要其他选项来支持其他库。以下是我的选项:
有人能告诉我这是否是问题的原因吗?如果不是,有人知道真正导致崩溃的原因吗?谢谢!
编辑
看起来错误发生在这个方法的第一个“if”中。
- (void)loginView:(FBLoginView *)loginView
handleError:(NSError *)error {
NSString *alertMessage, *alertTitle;
if (error.fberrorShouldNotifyUser) // CRASH HERE {
// If the SDK has a message for the user, surface it. This conveniently
// handles cases like password change or iOS6 app slider state.
alertTitle = @"Facebook Error";
alertMessage = error.fberrorUserMessage;
} else if (error.fberrorCategory == FBErrorCategoryAuthenticationReopenSession) {
// It is important to handle session closures since they can happen
// outside of the app. You can inspect the error for more context
// but this sample generically notifies the user.
alertTitle = @"Session Error";
alertMessage = @"Your current session is no longer valid. Please log in again.";
} else {
// For simplicity, this sample treats other errors blindly.
alertTitle = @"Unknown Error";
alertMessage = @"Error. Please try again later.";
NSLog(@"Unexpected error:%@", error);
}
}