I am using two buttons. I want to access these two buttons object from two different function.-
(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
button1= [UIButton buttonWithType:UIButtonTypeRoundedRect] ;
button2= [UIButton buttonWithType:UIButtonTypeRoundedRect] ;
button1.frame = CGRectMake(50, 50, 100, 30);
button2.frame = CGRectMake(160, 50, 100, 30);
}
return self;
}
And My functions are foo() and bar(). In these functions i am using button1 and button2. But it is not working.