在网上看到两种解决办法:
第一种:设置自动引用计数关闭
You need to turn off Automatic Reference Counting. You do this by clicking on your project in the navigator (the top item in the finder-like thing on the left), then click on your target, select "Build Settings" and turn off the option "Objective-C Automatic Reference Counting" (you can use the search field on the upper right to search it).
http://blog.csdn.net/duanyipeng/article/details/7108200
第二种:去掉autorelease
Remove all retain
release
autorelease
NSAutoReleasePools
and retainCount
calls, since ARC makes them for you. With the exception of NSAutoReleasePool
s They have been replaced by @autorelease{}
.
Change
SBJSON *json4 = [[SBJSON new] autorelease];
to
SBJSON *json4 = [SBJSON new];
http://stackoverflow.com/questions/8236797/xcode-cocoa-release-is-unavailable-error