How many parameters does the main function take?
I am a iPhone beginner and i want to know 开发者_开发知识库how many parameters the main function takes.
you generally don't touch the main method.
typically you begin entering your code in your application delegate, specifically:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
The main() function is a standard C main(). It takes two parameters:
int main(int argc, char *argv[]) {}
As Isaac notes, usually you will use the main.m provided for you by XCode:
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
精彩评论