Gavin.han

致力于移动开发 技术改变生活

导航

第一个ios程序

Posted on 2012-10-12 23:14  gavin.han  阅读(286)  评论(0编辑  收藏  举报

1.贴图为快:

2.核心知识

(1)

声明代码:

@property (strong, nonatomic) IBOutlet UILabel *userOutput;
@property (strong, nonatomic) IBOutlet UITextField *userInput;

- (IBAction)setOutput:(id)sender;

实现代码:

@synthesize userOutput;
@synthesize userInput;

void)viewDidUnload

{
[self setUserOutput:nil];//重要知识点,释放内存!!!
[self setUserInput:nil];//
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (IBAction)setOutput:(id)sender {
self.userOutput.text=self.userInput.text;//点语言方式
//[[self userOutput] setText:[[self userInput] text]];//经典方法调用
}

(2)

可以通过代码实现,也可以通过Interface Builder编辑器实现,主要通过后一种方法实现。