简体   繁体   English

iOS模拟器应用内浏览器崩溃

[英]iOS Simulator in-app browser crashing

I'm implementing a Facebook based application and I'm testing it on iOS Simulator. 我正在实现一个基于Facebook的应用程序,并正在iOS模拟器上对其进行测试。 When I click to login on Facebook button an in-app browser appears, then I enter my username and password and finally push the login and the permission button, but this error message appears in the Console: 当我单击登录Facebook按钮时,出现一个应用内浏览器,然后输入我的用户名和密码,最后按下登录名和权限按钮,但是此错误消息出现在控制台中:

WebKit discarded an uncaught exception in the
webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: 
<NSInvalidArgumentException> *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]:
attempt to insert nil object from objects[0]

After that nothing happens on the screen, but when I restart my app, I'm authenticated from Facebook and I can use my app normally. 之后,屏幕上什么都没有发生,但是当我重新启动我的应用程序时,我已从Facebook进行身份验证,并且可以正常使用我的应用程序。

How can I fix this issue? 如何解决此问题? Will this happen on a real device? 这会在真实设备上发生吗?

Maybe your app is trying to cache some of their Facebook data in one of your objects. 也许您的应用正在尝试将其中一些Facebook数据缓存在您的一个对象中。 Perhaps you need to make a nil verification, then if any of the required fields are not set in Facebook, you'd see the crash you mentioned. 也许您需要进行nil验证,然后,如果未在Facebook中设置任何必填字段,则会看到您提到的崩溃。

Try to verify if self.userProfile or other properties are non-nil. 尝试验证self.userProfile或其他属性是否为非零。

最后,我解决了这个问题:我尝试访问-(void)loginViewShowingLoggedInUser:(FBLoginView *)loginView方法中的用户数据,但是-(void)loginViewFetchedUserInfo:(FBLoginView *)loginView尚未被调用一,因此未获取用户数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM