iPhone 模拟器出问题了
我编写了一个应用程序来保存用户输入的文本,并且它在 iPhone 和 iPad 模拟器上完美运行。我关闭了 Xcode,一小时后重新打开它,在提交之前仔细检查,然后遇到了一个奇怪的问题。该应用程序在iPad模拟器上仍然可以完美运行,但在iPhone模拟器上,它不会再保存数据。另外,当我关闭应用程序,然后从多任务栏重新打开它时,它会崩溃。一小时前它在两个模拟器上都运行得很好,我根本没有改变任何东西。我还恢复了之前拍摄的快照,当时我 100% 确定经过全面测试后它完美运行,但同样的问题仍然出现。
我认为我的 iPhone 模拟器出问题了。如果确实存在问题,那么在 iPad 模拟器上也会产生同样的效果,对吗?还有其他人遇到过这个问题吗?我已经重置了计算机并删除了模拟器内容和设置,但似乎不起作用。
I wrote an app that saves the users inputted text, and it ran perfectly on the iPhone and iPad simulator. I closed Xcode, reopened it an hour later to double check it before I submit it, and ran into a weird issue. The app still runs perfectly on the iPad simulator, but on the iPhone simulator, it won't save the data anymore. Also, when I just close the app, then reopen it from the multitasking bar, it crashes. It was running perfectly on both simulators an hour ago, and I didn't change anything at all. I also restored a snapshot I took earlier when I was 100% sure it worked perfect after thorough testing, but the same issue is still occurring.
I think my iPhone simulator is on the fritz. If there was truly an issue with it, it would have the same effect on the iPad simulator, right? Has anyone else run into this issue? I already reset my computer and erased the simulators content and settings, didn't seem to work though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIApplication 委托方法仅属于应用程序委托,并且它应该实现 UIApplicationDelegate 协议方法, 如文档中所述。
如果您希望其他类对象在 applicationWillResignActive 启动后执行某些操作,您可以在该方法中放置一些代码来实现这一点。 这是建议的链接关于如何做到这一点。为什么其他类中有 applicationDidEnterBackground: 方法?这可能与您的问题有关,并且应该很容易解决。
UIApplication delegate methods only belong in the application delegate, and it should be implementing the UIApplicationDelegate protocol methods, as explained in the documentation.
If you want other class objects to do something after applicationWillResignActive is started, you can put some code inside that method to make that happen. Here is a link to a suggestion on how to do that. Why do you have applicationDidEnterBackground: methods inside other classes? This may be related to your problem, and should be easy enough to fix.