我正在尝试为 iOS 设置 facebook SDK 3.5。我已经让它工作得很好,但它现在崩溃了。只有当用户通过默认的 iOS facebook 设置(也不是应用商店中的 facebook 应用程序)登录时,才会发生崩溃。当点击 facebook“登录”视图时,该应用程序会崩溃。
崩溃是:错误:[NSError fberrorShouldNotifyUser]:无法识别的选择器发送到实例。
我做了一些研究,有些人建议将 -Objc 放入“其他链接器标志”。我没有确切的,但我认为我有类似的东西。我需要其他库的其他选项。这是我的选择:
谁能告诉我这是否导致了问题?如果没有,有谁知道真正导致崩溃的原因是什么?谢谢!
编辑
似乎在第一个“如果”的时候,这个方法就发生了错误
- (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);
}
}