4

According to the IOS Developer Library at: https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/FirstTutorial.html

The main function in main.m calls the UIApplicationMain function within an autorelease pool.

However, in XCode 6.3 it appears that there is no longer a "main.m" file. What has replaced the "main.m" file?

Thanks.

Mark B
  • 147
  • 2
  • 8

1 Answers1

5

Your tags indicate that you use Swift, not Objective-C. Swift uses different mechanisms to start up your program. In general, it does not need a main function, since it is legal to write code that is not contained in a function.

The Swift project template tags the NSApplicationDelegate implementation with @NSApplicationMain (or @UIApplicationMain on iOS). This tells the compiler to generate a main function which calls NSApplicationMain.

Community
  • 1
  • 1
zneak
  • 134,922
  • 42
  • 253
  • 328