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];
解决方案 »
- UIAlertView 的 Release问题
- ipad当前页面显示多个tableview怎么实现
- iOS词典应用SDK
- ios缩小动画的问题!
- 对图片加入特定水印的方法
- 请问能不能在iphone应用里加入浏览器控件
- xcode5.1一run就意外退出。求高手解答!
- UITabBarController 可以调整到顶部吗(默认是底部的)
- 求教
- 如何在xcode , mac OS系统开发环境下,开发一款APP,实现驾校考试基本的答题功能(选择题目),并有错题统计,实时显示答案,及天气查询功能???
- ASIHTTPRequest 编码问题
- 北京时间离GMT时间不是相差8小时吗?为什么1980-1-1 0:0:0被转换后,相差7小时
我DEBUG代码,发现promptWindow已经执行了release操作,但是弹出的窗口依然存在,为什么不会出错? 我没有调用retain啊,难道系统内部自动调用了retain?
另外,数组的addObject也会使对象的引用计数+1。通常所说的,retain release是指显示的调用,其实在系统内部机制中,有许多需要注意的地方。
这些只有慢慢在开发中理解,并就用自如。