◆ 무한한 가능성/& MAC - iOS

[iPhone] Make application without IB

치로로 2010. 8. 10. 16:53
Source> http://cafe.naver.com/mcbugi/71945


1. create new Project 'Window-based Application'

2. delete '*.xib' file

3. delete these two lines in '*.plist' file
    <key>NSMainNibFile</key>
    <string>MainWindow</string>

4. replace UIApplicationMain argument in 'main.m' file
    int retVal = UIApplicationMain(argc, argv, nil, @"WindowsNoXibAppDelegate");

5. delete 'IBOutlet' string in window @property in '*AppDelegate.h' file
@property (nonatomic, retain) UIWindow *window;

6. insert few lines to method in '*AppDelegate.m' file
- (void)applicationDidFinishLaunching:(UIApplication *)application {   
    UIWindow *localWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    localWindow.backgroundColor = [UIColor redColor];
   
    self.window = localWindow;
    [localWindow release];
   
    // Override point for customization after application launch
    [window makeKeyAndVisible];
}


[Ref.]
http://code-dojo.blogspot.com/2009/11/build-iphone-application-without.html