ios 开发中遇到 UIAlertView 窗口无法release的问题
来源:互联网 发布:马佳佳 知乎 编辑:程序博客网 时间:2024/05/17 08:03
程序中有如下代码:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Something was done." message:@"ok" delegate:self cancelButtonTitle:@"OK!" otherButtonTitles:nil]; [alert show]; [alert release];
在xcode环境中 报告错误
error: 'release' is unavailable: not available in automatic reference counting mode [3]
解决办法:
在xcode中选择 project navigator (最左边的视窗)->选中项目名称 ->在主窗口中显示的 project 和targets中选择 project面板->选择building settings-> 在Apple LLVM compiler 3.0 -language 中选择 Ojective-C Automatic Reference couting 选项,把yes 修改成no。
也可以在建立项目的时候不要选择Using Automatic Reference counting 选项。
ARC 是4.2新提供的选项
相关文章可以查看
http://stackoverflow.com/questions/6914453/dealloc-method-gone-from-the-viewcontroller-implementation-file-template-in-xcod
主要意思是
Most likely you have created a project that uses the new ARC (Automatic Reference Counting) and therefore do not need the dealloc method because calling retain or release is no longer allowed when compiling with this option.
所以不需要去手工release了
- ios 开发中遇到 UIAlertView 窗口无法release的问题
- iOS开发:UIAlertView使用的问题
- IOS开发中遇到的问题总结
- IOS开发中经常遇到的问题
- 最近iOS开发中遇到的问题
- ios开发中遇到的奇葩问题
- ios生命周期开发中遇到的问题
- ios 开发中遇到的一些问题
- iOS 开发中遇到的小问题
- IOS开发中遇到的各种问题
- iOS开发过程中遇到的问题
- iOS开发中遇到的问题
- iOS开发中遇到的问题整理
- iOS 开发中遇到的问题
- IOS开发中UIAlertView与UIAlertController的用法
- iOS中UIAlertView的使用方法
- 【iOS开发】ios9开发中遇到的问题
- IOS中关于UIButton release的问题
- SQL Server2005 sa登录错误及应对方案
- 使用JSP和Struts正确的解决用户退出问题
- 电子商务网站策划书
- 3DMax Plugin - Program 2
- 报告称中国每年因盗版软件“节省”8亿美元
- ios 开发中遇到 UIAlertView 窗口无法release的问题
- ubuntu JDK 安装
- 电子商务网站建设策划书范例
- 有些人不应该被忘记,也不会被忘记——谨以此文悼念C语言及UNIX之父Dennis Ritchie;
- ubuntu打包
- qt 双缓冲绘图
- powerDesiger关于OOM的说明
- EntityName 出错时的解决办法
- ChartDirector 统计图