tags:

views:

77

answers:

3

That's strange, since apple says that there is somewhere an main function. But I really can't find any.

It should look somehow like this:

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

What file is that where I can see it? Is it hidden?

+1  A: 

If you can't find it, you can always just create a new code file and copy in this function. When the project compiles, it will only allow you to have one main function, so if it disappeared at some point, you can just re-add it.

Alternately, you might have picked a project type that does not compile down to an executable. Not sure if/what these might be for iphone, but normally a "library" project will not have a main function.

Andy White
+1  A: 

Expand "Other Sources" in the Groups and Files section and the file is named main.m .

Lounges
+3  A: 
lhunath