WEB开发网
开发学院手机开发iPhone 开发 iPhone SDK 开发之 UIKit 使用 阅读

iPhone SDK 开发之 UIKit 使用

 2010-02-25 04:20:00 来源:WEB开发网   
核心提示:helloWorld = [ [ NSString alloc ] initWithString: @"Hello, World!" ];woahDizzy = [ [ NSString alloc ] initWithString: @"Woah, I'm Dizzy!"

helloWorld = [ [ NSString alloc ] initWithString: @"Hello, World!" ];

woahDizzy = [ [ NSString alloc ] initWithString: @"Woah, I'm Dizzy!" ];

}

return self;

}

- (void)loadView {

[ super loadView ];

textView = [ [ UITextView alloc ] initWithFrame:

[ [ UIScreen mainScreen ] applicationFrame ]

];

textView.text = helloWorld;

self.view = textView;

}

-(BOOL)shouldAutorotateToInterfaceOrientation:

(UIInterfaceOrientation)interfaceOrientation

{

return YES;

}

- (void)didRotateFromInterfaceOrientation:

(UIInterfaceOrientation)fromInterfaceOrientation

{

textView.text = woahDizzy;

}

- (void)viewDidLoad {

[ super viewDidLoad ];

}

- (void)didReceiveMemoryWarning {

[ super didReceiveMemoryWarning ];

}

- (void)dealloc {

[ helloWorld release ];

[ woahDizzy release ];

[ textView release ];

[ super dealloc ];

}

@end

Example 3-11. ControllerDemo main (main.m)

#import <UIKit/UIKit.h>

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

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

int retVal = UIApplicationMain(argc, argv, nil, @"ControllerDemoAppDelegate");

[pool release];

return retVal;

}

上一页  1 2 3 4 

Tags:iPhone SDK 开发

编辑录入:coldstar [复制链接] [打 印]
赞助商链接