我正在尝试将 Facebook API 集成到我的 iOS 应用程序中,但出现以下错误:
WebKit 在 webView:decidePolicyForNavigationAction:request:frame:decisionListener:delegate: Application 试图以模态方式呈现活动控制器中丢弃了一个未捕获的异常。
我该如何解决这个错误?
这是我的代码:
[_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];
NSString *redirectUrlString = @"http://www.facebook.com/connect/login_success.html";
NSString *authFormatString = @"https://graph.facebook.com/oauth/authorize?client_id=%@&redirect_uri=%@&scope=%@&type=user_agent&display=touch";
NSString *urlString = [NSString stringWithFormat:authFormatString, _apiKey, redirectUrlString, _requestedPermissions];
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[_webView loadRequest:request];
为了检查登录凭据,我在函数中编写了以下代码logincheck
if ([urlString rangeOfString:@"login.php"].location != NSNotFound)
{
[_delegate displayRequired];
}