- (void)main {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
while (YES) {
NSAutoreleasePool *subPool = [[NSAutoreleasePool alloc] init];
[runLoop run];
[subPool drain];
}
[pool drain];
}
I don’t understand why this code receives such a warning, especially if it has almost the same structure as the main function main.m generated by Xcode itself, which does not receive the same warning:
int main(int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
source
share