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