开发者

Setting property of a subview

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜