我不知道如何卡住這個簡單的事情,但我不能讓我的按鈕來更改我的標籤。我錯過了什麼?更改標籤的按鈕
FirstViewController.h:
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *quoteButton;
@property (weak, nonatomic) IBOutlet UILabel *quoteLabel;
@end
FirstViewController.m:
#import "FirstViewController.h"
@implementation FirstViewController
#pragma mark - User Interaction
- (IBAction)quoteButtonPressed {
self.quoteLabel.text = @"Hello World";
}
@end
る連接你在IBOutlet中其他RU按鈕,在您的按鈕創建編程 –
在 - (IBAction)quoteButtonPressed中使用nslog來檢查動作是否綁定到當前函數..還檢查標籤連接.. –