iPhone SDK 开发之 UIKit 使用
2010-02-25 04:20:00 来源:WEB开发网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;
}
- ››开发Android 日历教程
- ››开发学院总结 Win 8实用技巧大全
- ››开发学院原创教程:把win8的IE10放桌面上方法(非...
- ››iphone图片拉伸的几种方法
- ››iphone正则表达式的简单使用
- ››iPhone开发Unresolved Symbols CAKeyframeAnimati...
- ››IPhone开发-“此证书是由未知颁发机构签名”解决方...
- ››IPhone开发-整合私钥和证书,生成.p12文件
- ››iPhone应用开发-UIPickerView选取器详解
- ››iphone 获取屏幕的宽度和高度
- ››iPhone读取工程包中的二进制文件
- ››iPhone新手机 不挂YouTube APP
更多精彩
赞助商链接