Objective C 错误整理

1. NSAutoreleasePool' is unavailable: not available in automatic reference counting mode 

X-code 4.2,苹果引入了自动记算引用数的功能,所以老的项目中

NSAutoreleasePool  * pool = [[NSAutoreleasePool allocinit];是报错的,必须把arc(auto-reference-command)关闭才行,方法如下:

Build settings--->Apple LLVM compiler 3.0- Language--->Objective-C Automatic Reference Counting 将YES改为NO。

如果是ios5 需要在main的头部引入 #import "AppDelegate.h" 才可以解决。

posted on 2013-03-02 18:21  花郎V  阅读(408)  评论(0编辑  收藏  举报