I have a UIView containing among others a subview.
-(void) viewDidLoad
{
geopointView = [[UIView alloc] initWithFrame:CGRectMake(0, 350, 100, 80)] ;
UIButton *SaveButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain] ;
SaveButton.frame = CGRectMake(0, 40, 100, 40) ;
开发者_JAVA百科 [geopointView addSubview:SaveButton];
}
I want to set userInteractionEnabled property of this subview in another method.
How can I dot it? thanks for any help in advance.
declare the savebutton in the header file. You have declared it as a local member.Have it declared as a global variable.
精彩评论