
打開(kāi)Xcode,選擇第二項(xiàng):Create a new Xcode project

選擇 Single View Application
點(diǎn)擊 Next

填寫好 ?點(diǎn)擊 Next
選擇 目錄 -->Next
就看到 如下界面:

這就是 Xcode 平時(shí)寫代碼的 界面了

輸入 圖中代碼 ? 快捷鍵 cmd + R ?運(yùn)行程序
代碼:
UILabel*label = [[UILabelalloc]initWithFrame:CGRectMake(100,100,200,100)];
label.text=@"hello world !";
label.font= [UIFontsystemFontOfSize:22];
label.textAlignment=NSTextAlignmentCenter;
label.textColor= [UIColorcyanColor];
label.backgroundColor= [UIColorredColor];
[self.viewaddSubview:label];
程序 運(yùn)行結(jié)果:
