DEBUG时候发现调用show之后立即调用了release,提示窗口还在显示,按钮还能响应,怎么回事呢?
show竟然不是堵塞的!!!什么原理UIAlertView *promptWindow = [[UIAlertView alloc]initWithTitle:
@"XXX。"
message:nil
delegate:self
cancelButtonTitle:@"去设置"
otherButtonTitles:@"知道了",
nil];
promptWindow.restorationIdentifier = @"not_first_open";
[promptWindow show];
[promptWindow release];
show竟然不是堵塞的!!!什么原理UIAlertView *promptWindow = [[UIAlertView alloc]initWithTitle:
@"XXX。"
message:nil
delegate:self
cancelButtonTitle:@"去设置"
otherButtonTitles:@"知道了",
nil];
promptWindow.restorationIdentifier = @"not_first_open";
[promptWindow show];
[promptWindow release];
解决方案 »
- 初学者求教!UITableView不触发tableView:didSelectRowAtIndexPath:
- 关于苹果消息推送的问题。
- UIScrollView的滚动问题
- 怎么把txt格式的做成iphone中的电子书
- 求一个思路, 类似 MSN 界面上只有一部分内容在动画更新的问题.
- 请教各位大神,admob里面的转化率是怎么实现的?
- iOS7 系统原生的分享有办法调用吗?
- 新手请教做新闻阅读类应用详细页面问题
- ios8如何获取当前wifi的ssid?
- 强制横屏的App,iPhone项目在调用拍照或相册功能时会崩掉
- ASIHTTPRequest 编码问题
- 北京时间离GMT时间不是相差8小时吗?为什么1980-1-1 0:0:0被转换后,相差7小时
我DEBUG代码,发现promptWindow已经执行了release操作,但是弹出的窗口依然存在,为什么不会出错? 我没有调用retain啊,难道系统内部自动调用了retain?
另外,数组的addObject也会使对象的引用计数+1。通常所说的,retain release是指显示的调用,其实在系统内部机制中,有许多需要注意的地方。
这些只有慢慢在开发中理解,并就用自如。