0
在ViewController.h,IBAction爲不顯示作爲一個選項
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
IBOutlet UILabel *scoreLabel;
IBOutlet UILabel *timerLabel;
}
- (IBAction)buttonPressed;
@end
在ViewController.m,
#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)buttonPressed {
NSLog(@"Pressed!");
}
@end
,我嘗試通過點擊按鈕,在我的ViewController以buttonPressed IBAction爲連接按鈕同時按住Ctrl並在後臺拖動它。我應該看到buttonPressed作爲一個選項,但我沒有看到它。怎麼來的?
首先,它看起來像是在拖拽錯誤的東西。如果您正在拖拽/從視圖_controller_,則不會看到這些約束。 – matt 2014-10-17 03:08:31