导航控制器崩溃
我有一个关于 iPhone 开发的问题,
CarDetailDetail *myview = [[[CarDetailDetail alloc] init] autorelease];
myview.detailMaintainID = self.detailMaintainID;
[[self navigationController] pushViewController:myview animated:YES];
这在 iPhone 4 (iOS 4.3) 和 iPhone 3gs (iOS 5.X) 上工作得很好,
但 iPod touch (iOS 4.2) 当我弹出一两次时就会崩溃, 会出现内存警告并且出现错误访问错误
,但是当我不释放 *myview (删除 autorelease 关键字)时,iPod 工作正常...
我不知道为什么,有人可以帮助我吗?谢谢
I have a question about iPhone develop
CarDetailDetail *myview = [[[CarDetailDetail alloc] init] autorelease];
myview.detailMaintainID = self.detailMaintainID;
[[self navigationController] pushViewController:myview animated:YES];
this is work fine in iPhone 4 (iOS 4.3) and iPhone 3gs (iOS 5.X)
but iPod touch (iOS 4.2) will crash when I pop back one or two times,
memory warning will appear and has bad access error
but when I not release *myview (remove autorelease keyword) , iPod works fine...
I don't know why , some one can help me? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试弹出动画上的“是/否”标志
如果您发现问题设备上没有出现弹出动画而崩溃,则可能表明存在某种计时问题。
换句话说,一个块或网络线程正在尝试访问已经被释放的视图控制器。
也将您的控制台日志发布到问题中以获得更多帮助。
Experiment with the YES/NO flag on the pop animation
If you find that you are getting no crash on your problem device with NO pop animation it probably indicates a timing issue of some sort.
In other words a block or web thread is trying to hit a view controller which has been deallocated already.
post your your console logs in the question too for more help.
尝试这样做
try doing this