1.贴图为快:

第一个ios程序

第一个ios程序

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编辑器实现,主要通过后一种方法实现。

 

 

 

第一个ios程序

相关文章:

  • 2021-12-03
  • 2021-10-14
  • 2021-07-26
  • 2022-12-23
  • 2021-11-06
  • 2021-12-09
猜你喜欢
  • 2021-07-13
  • 2021-08-24
  • 2022-02-01
  • 2021-10-02
  • 2021-07-09
  • 2021-04-10
相关资源
相似解决方案