【发布时间】:2013-05-13 20:55:45
【问题描述】:
我正在尝试为 iOS 设置 facebook SDK 3.5。我已经让它工作得很好,但它现在崩溃了。只有当用户通过默认的 iOS facebook 设置(也不是应用商店中的 facebook 应用程序)登录时,才会发生崩溃。当点击 facebook“登录”视图时,应用程序会崩溃。
崩溃是:错误:[NSError fberrorShouldNotifyUser]:无法识别的选择器发送到实例。
我已经做了一些Research 并且有些人建议将 -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);
}
}
【问题讨论】:
标签: ios objective-c xcode facebook