iphone 开发学习

来源:互联网 发布:pudn程序员联合开发网 编辑:程序博客网 时间:2024/06/06 09:55

第一天:开始学习想用pc 装虚拟机,结果发现 vitural  halt off   没有虚拟化,算了。

第二天:想买个mac G5 看看 根本不能开发,mac os系统更新很快,现在是lions 10.7.3  硬件配置不行啦

第三天:买个pc 装黑苹果吧,淘宝里面也商家现成装好的,担心再折腾几天,算了,直接买mac mini。

第四天: 回来装系统,下一步一下,注意  我使用的双击 空格键 下一步的,有时点击太快,都键盘死住不动啦。

第 五天: 看object-c,晚上找同事要了个xcode 4.3.1 ,说是最新版的。

第六天:安装xcode 4.3.1,mac 10.7.2,结果提示  系统版本太低,好吧,更新mac 成为 10.7.3,再次安装 xcode 4.3.1,结果提示 少了一个组件,那就下载个xcode 4.3.2吧

同样提示,组件缺少,点install 安装好组件。


打开 xcode ,大体看了一下,new  project  试试,拖了个button 和 label 放上 ,运行都ok。


第七天:照网上的例子,写了个点击button 输出helloworld 都 textfiled 中。 前台界面和后台程序完全隔离,还有 xcode 4.3.2 已经集成了 inteerface builder 。


前台界面和后台程序完全隔离,最后通过 联线方式 结合到一起。


代码:

HelloWorldViewController.h 代码:


#import <UIKit/UIKit.h>

@interface HelloWorldViewController : UIViewController{//看为一个页面
    IBOutlet  UITextField * mesgBox;//init  textfiled
}
@property (atomic,retain) IBOutlet  UITextField * mesgBox;//equal  get and set method

-(IBAction) buttonClick;//button  click

@end


HelloWorldViewController.m代码:

#import "HelloWorldViewController.h"

@interface HelloWorldViewController ()

@end

@implementation HelloWorldViewController

@synthesize mesgBox;


-(IBAction) buttonClick{
    mesgBox.text=@"hello world";
}
 

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

@end


最后联线 。


执行正常。







原创粉丝点击