Any idea why i get these messages -
"NSAutoreleasePool is unavailable: not available in automatic reference counting mode"
"ARC forbids explicit message send of 'release' "
import
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
This is because you are compiling with Automatic Reference Counting on. You need to use a different construct with ARC:
ReplyDelete@autoreleasepool {
// Your code
}
Another option is to turn off ARC for a specific file.
Yeah, you have Automatic Reference Counting enabled, which doesn't allow you to explicitly use 'release'. You need to either disable ARC or change your main method to look like this:
ReplyDeleteint main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}