James Franco
James Franco

Reputation: 4706

Navigating my way around a project

I am currently in the process of learning ios development. I recently downloaded a project and wanted to navigate through it. I started with the main file expecting to see something like this

#import <UIKit/UIKit.h>
#import "AppDelegate.h"

int main(int argc, char * argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

In the above code I would easily know which delegate to explore and in return that delegate would be responsible for launching the nib file. However I came across a project with the main as such

#import <UIKit/UIKit.h>

int main(int argc, char *argv[]) {

    @autoreleasepool {
        int retVal = UIApplicationMain(argc, argv, nil, nil);
        return retVal;
    }
}

I am not sure as how to deal with this file ? How do I know what goes next or which nib file is launched next ?

Upvotes: 0

Views: 80

Answers (1)

Priyatham51
Priyatham51

Reputation: 1884

In this case ios will look into the Info.plist to find the class to load it. Check the documentation.

// If nil is specified for principalClassName, the value for NSPrincipalClass from the Info.plist is used. If there is no
// NSPrincipalClass key specified, the UIApplication class is used. The delegate class will be instantiated using init.
UIKIT_EXTERN int UIApplicationMain(int argc, char *argv[], NSString *principalClassName, NSString *delegateClassName);

Upvotes: 2

Related Questions