Skip to content
Search

NSAutoreleasePool

lastmod 2014-02-08created 2014-02-082 edits

  • main.m: The first file to be executed.
#import <UIKit/UIKit.h>
#import "SampleAppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([SampleAppDelegate class]));
    }
}
  • Older versions have the following structure.
#import <UIKit/UIKit.h>

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, @"appDelegate");
    [pool release];
    return retVal;
}

Favorite site