UIAlertView在ios4,ipad3.2上可能导致死机

如题,在提交完一个文档后,我给出一个弹出提示,并关闭当前窗口并返回上一层窗口,此时会发现屏幕还是蒙着一层阴影,就是弹出模式窗口时的样子,点击完全无响应,只能按home退出
在做注销时也出现了,弹出提示询问对话框后,注销返回登录界面,死机.

解决方法如下:

In iOS 4.0, you may want to call this method whenever your application moves to the background. An alert view is not dismissed automatically when an application moves to the background. This behavior differs from previous versions of the operating system, where they were canceled automatically when the application was terminated. Dismissing the alert view gives your application a chance to save changes or abort the operation and perform any necessary cleanup in case your application is terminated later.

//***************************************************

另外碰到一个问题,举例如下:批阅公文,选接处理人,按确定,这时需要先nav.pop退出选人窗口,再回调公文窗口的提交函数,提交函数弹出了一个ancitonSheet显示等待信息,在iphone(3,4)上完全没问题,但是iPad上就崩溃了,原因是:

[UIActionSheet showInView:] 'Invalid parameter not satisfying: view != nil'

我是这样认为的,ios为了保证较好的动画效果,pop时启动了一个窗口切换动画,这个动画需要消耗一定时间,即使你设置了animate=NO,在做完动画前如果启动actionsheet,会导致它无法判断所属的view是哪个(nil?),我尝试过了用公文窗口作为它的view,没用,用选人窗口估计也不合适,最后不得不在didAppear事件中才提交。

你可能感兴趣的:(ios)