开发者

myButton.frame not available why?

开发者 https://www.devze.com 2023-01-20 07:48 出处:网络
i have a button when i try 开发者_如何转开发to write myButton. then if I click esc button there is not options or any intelligent result.

i have a button when i try 开发者_如何转开发to write myButton. then if I click esc button there is not options or any intelligent result.

thanks


Does your code look like this?

@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

Or This:

@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

if it's the latter, myButton isn't the private variable - only the property.

0

精彩评论

暂无评论...
验证码 换一张
取 消