I made a simple app in which i am loading different .xib
on each orientation,
I have two xib's Portxib
and Landxib
, in both xibs, i dragged a button and assigned a
tag value to it as 1
in both xib's.
and i wrote this code in my viewDidLoad
UIButton *btn=(UIButton *)[self.view viewWithTag:1];
[btn addTarget:self action:@selector(BtnClick:) forControlEvents:UIControlEventTouchUpInside];
here is the selector method,
-(void)BtnClick:(id)sender
{
NSLog(@"BtnClick");
}
Click event of UIButton is not getting fired...
OR
Is there any other way to call the same method of button from both the orientation ??
EDIT :
.h file
.m file