Created
January 15, 2012 07:54
-
-
Save DmitrySkiba/1614967 to your computer and use it in GitHub Desktop.
Simple iOS app (from Itoa tutorial)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
/* | |
* ApplicationDelegate | |
*/ | |
@interface ApplicationDelegate: NSObject<UIApplicationDelegate> { | |
UIWindow* m_window; | |
} | |
@end | |
@implementation ApplicationDelegate | |
-(void)dealloc { | |
[m_window release]; | |
[super dealloc]; | |
} | |
-(void)applicationDidFinishLaunching:(UIApplication*)application { | |
CGRect bounds=[[UIScreen mainScreen] bounds]; | |
UIWindow* window=[[UIWindow alloc] initWithFrame:bounds]; | |
window.backgroundColor=[UIColor darkGrayColor]; | |
UILabel* label=[[UILabel alloc] init]; | |
label.text=@"Hello iOS!"; | |
label.frame=CGRectMake(0,0,150,50); | |
label.center=window.center; | |
label.textAlignment=UITextAlignmentCenter; | |
[window addSubview:label]; | |
[window makeKeyAndVisible]; | |
m_window=window; | |
} | |
@end | |
/* | |
* main | |
*/ | |
int main(int argc,char* argv[]) { | |
NSAutoreleasePool* pool=[[NSAutoreleasePool alloc] init]; | |
UIApplicationMain(argc,argv,NULL,@"ApplicationDelegate"); | |
[pool release]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment