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

Above the list of build settings are two sets of buttons. The first set is Basic/All. Clicking the Basic button shows the most commonly accessed build settings. Clicking the All button shows all the build settings.

The second set of buttons is Combined/Levels. The screenshot shows what appears when you click the Levels button. Multiple columns of build settings are visible: default, project, target, and resolved. If you select the project from the build settings editor instead of the target, there is no column for the target. Showing levels allows you to see any changes from the default build settings as well as any differences between project and target build settings.

If you click the Combined button, one column of build settings appears in the editor. The column shows the effective value of each build setting, the value Xcode will use when you build the project. Showing the combined build settings simplifies changing a build setting’s value.

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" 才可以解决。


你可能感兴趣的:(NSAutoreleasePool' is unavailable: not available in automatic reference counting mode)