您的位置:首页 > 其它

程序真正的入口

2014-09-28 23:16 176 查看
#import "TRAppDelegate.h"

@implementation TRAppDelegate

//程序真正的入口
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    //创建window对象
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    //设置window对象的背景颜色
    self.window.backgroundColor = [UIColor whiteColor];
    
    //向window对象中加一个标签对象
    UILabel *label = [[UILabel alloc]init];
    label.text = @"Hello world.";
    CGRect frame = {50, 100, 100, 30};
    label.frame = frame;
    [self.window addSubview:label];
    
    
    //让window对象显示出来
    [self.window makeKeyAndVisible];
    //程序继续
    return YES;
}
@end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: