开发者

How many parameters does the main function take?

开发者 https://www.devze.com 2023-01-08 11:05 出处:网络
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.

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消