In the Windows world, in Visual Studio, the best way to create new project was to check "Empty project" checkbox in the Win32 application wizard.
In Xcode, for an iPhone project, the IDE generates for me a lot of files, makes folders. If I'm just learning, if I'm just testing all these files and folders just fulfill my hard disk.
So I found a way to create such "empty" project in Xcode:
1. Create new project in Xcode: Window-based template, any name,... everything's as usual.
2. In Xcode sidebar, select "Classes" and delete them. In the alert window choose "Also move to Trash".
3. Delete xib-file.
4. Modify *-info.plist file: delete the line about MainWindow - probably, the last one.
5. Open main.m file and add a simple application delegate. Then set the name of the delegate in the main() function.
Here is my main.m file:
#import <UIKit/UIKit.h>6. Compile and Run:
// Application delegate
@interface Simple : NSObject <UIApplicationDelegate>
{
}
@end
@implementation Simple
- (void)applicationDidFinishLaunching: (UIApplication*)application
{
UIWindow* window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
[window setBackgroundColor: [UIColor yellowColor]];
[window makeKeyAndVisible];
}
@end
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"Simple");
[pool release];
return retVal;
}
No comments:
Post a Comment