当我尝试编写myButton时,我有一个按钮。然后,如果我点击esc按钮,则没有选项或任何智能结果。
感谢
答案 0 :(得分:1)
你的代码看起来像这样吗?
@interface myViewController : UIViewController {
UIBUtton *myButton;
}
@property (nonatomic, retain) IBOutlet UIButton *myButton
@end;
@implementation myViewController
@synthesize myButton;
- (void) someMethod
{
//Use myButton Here?
CGRect r = myButton.frame;
}
@end
或者这个:
@interface myViewController : UIViewController {
// No need to declare myButton for iPhone or Mac 64-bit
}
@property (nonatomic, retain) IBOutlet UIButton *myButton
@end;
@implementation myViewController
@synthesize myButton;
- (void) someMethod
{
//Use myButton Here?
CGRect r = self.myButton.frame;
}
@end
如果是后者,myButton
不是私有变量 - 只有属性。