导航控制器崩溃

发布于 2024-12-15 05:02:40 字数 459 浏览 1 评论 0原文

我有一个关于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡淡的优雅 2024-12-22 05:02:40

尝试弹出动画上的“是/否”标志

如果您发现问题设备上没有出现弹出动画而崩溃,则可能表明存在某种计时问题。

换句话说,一个块或网络线程正在尝试访问已经被释放的视图控制器。

也将您的控制台日志发布到问题中以获得更多帮助。

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.

梦在深巷 2024-12-22 05:02:40

尝试这样做

 CarDetailDetail *myview = [[CarDetailDetail alloc] initWithNibName:<name of view contrlle> bundle:nil];
 //Remove this bit of code myview.detailMaintainID = self.detailMaintainID;

[[self navigationController] pushViewController:myview animated:YES];
[myview release];

try doing this

 CarDetailDetail *myview = [[CarDetailDetail alloc] initWithNibName:<name of view contrlle> bundle:nil];
 //Remove this bit of code myview.detailMaintainID = self.detailMaintainID;

[[self navigationController] pushViewController:myview animated:YES];
[myview release];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文