0

我在工作中开发 POC 时遇到困难。

目前我的应用程序的流程如下:应用程序启动,委托实例化加载视图,加载视图提示用户警报,警报接受然后应用程序切换到注册视图完成注册过程并保存 - 将详细信息写入文件切换到添加考勤查看记录已提交,然后按下主页按钮

再次启动应用程序时,应出现加载视图,然后检查应用程序包中是否存在设置文件如果文件存在 - 直接将视图切换到考勤视图(用户已经注册),否则切换到注册视图。

但是,当应用程序重新启动时,它会跳过任何加载屏幕,并直接进入考勤屏幕,这是一系列预先填充的文本字段,其中没有一个是根据需要预先填充的。

这似乎是维护应用程序状态帖子发送出勤记录的问题。

我不是本地 ios 开发人员,我正在努力理解我哪里出错了,我们将不胜感激。

4

1 回答 1

0

From what you wrote it would seem you are talking about application returning from background. Since you said you are not a native iOS developer, this is closer to minimizing a desktop application and then expand it again (all the threads are paused after some short time though). So yes, the application stays where you left it and nothing is reloaded.

Apple prepared a few methods usually located in application delegate class, for this case it would be - (void)applicationDidBecomeActive:(UIApplication *)application. Once this gets called you will have to reload application state.

Also there used to be parameter in "plist" where you could enable/disabled permission for the application to enter background. If you do not allow it to enter background it will close and will be forced to restart, fixing your problem. This though is not the most elegant solution and it might not even be allowed anymore.

于 2013-04-29T13:17:05.843 回答