我是 Objective-C 和 Xcode 的新手。
我做了第一个程序“Hello Word”,现在我想将“hello word”消息更改为另一条消息。这是我的代码中的示例:
。H
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
IBOutlet UILabel * label;
IBOutlet UIButton * boton;
}
-(IBAction)click:(id)sender;
@end
.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
-(IBAction)click:(id)sender{
label.text = @"hello Word" ;
label.text = @"here is the second string";
// i would like when i touch again the button to change to this string
}