tags:

views:

38

answers:

2

I am a iPhone beginner and i want to know how many parameters the main function takes.

+1  A: 

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 {
isaac
A: 

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;
}
Seamus Campbell