【问题标题】:UIAlertView and cocos2d memory mangementUIAlertView 和 cocos2d 内存管理
【发布时间】:2011-04-03 21:53:54
【问题描述】:

我在 cocos2d 层上方显示了一个 UIAlertView。

我会按照我的方式发布它。

真的没有了吗?我是否必须以某种方式从我的 UIView 中删除它?

【问题讨论】:

  • 你能把你创建和显示它的代码贴出来,以及你发布它的代码吗?

标签: iphone uikit cocos2d-iphone


【解决方案1】:

如果你这样做

UIAlertView* alert = [[UIAlertView alloc] initWithTitle...];
[alert show];
[alert release];

那么就不用担心了。但是,如果您将警报的委托设置为某个对象,请确保当用户点击警报中的按钮时该对象仍然存在 - 否则当警报尝试调用 alertView:didDismissWithButtonIndex: 委托方法时,您的应用将崩溃。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-16
    • 2011-09-20
    • 1970-01-01
    • 2016-10-12
    相关资源
    最近更新 更多