Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / iOS版的Hello world

最近下载了个xcode_4.3.1_for_lion.dmg   ,安装  xcode  时老是提示安装失败,后来网上查了下,把mac日期修改成2012.1.1,才能安装成功。第一次写ios程序啊,程序相当简单,就一个helloworld  点击按钮触发alert事件开发环境 mac 10.7.3  xocde4.3.1   ios5.1.x开发步骤1. 下载安装 xcode_4.3.1_for_lion.dmg2.运行xcode3.新建一个Single View   Application4.创建完成后双击文件中的MainStoryboard_iPad.storyboard文件打开设计界面5.拖个Round Rect Button控件到界面里面6.修改ViewController.h头文件 加入代码@interface ViewController : UIViewController{IBOutlet UIButton * btn;}-(IBAction)btnPressed:(id)sender;7.修改ViewController.m文件  加入代码-(void)btnPressed:(id)sender{NSLog(@"33333333");UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@"hello"message:@"zhu"delegate:selfcancelButtonTitle:@"ok"otherButtonTitles:nil];[alert show];}8.右键单击View中添加的按钮分别添加Touch Up Inside  跟 btnPressed, Referencing Outlets跟btn的 关联9.虚拟机运行效果10.真机调试时如果有如下提示,需要进行xcode破解12.  在的越狱的板子上运行效果