开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜