Why does a new Objective-C project's boilerplate contain an autorelease pool block, but a new Swift project doesn't?

#import <Cocoa/Cocoa.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // Setup code that might create autoreleased objects goes here.
    }
    return NSApplicationMain(argc, argv);
}

Because the Swift project uses @main, so there’s no main.swift, so there’s no place where you can add initialisation code that would benefit from that autorelease pool.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Why does a new Objective-C project's boilerplate contain an autorelease pool block, but a new Swift project doesn't?
 
 
Q