In View Controller.m
@interface ViewController ()
{
CustomView *view;
}
@implementation ViewController
-(void)viewDidLoad {
[super viewDidLoad];
view = nil;
view = [[CustomView alloc]init];
[self.view addSubview:view];
}
In CustomView.m
-(CustomView *)init
{
CustomView *result = nil;
result = [[[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:self options:nil] objectAtIndex:0];
return result;
}
I have two buttons in my custom view. My Custom view was loaded fine as expected but button actions not fired if enable ARC for CustomView.m file, If I disable ARC then Button actions are firing…
Where Im going wrong..
Is it the correct way of loading a nib of uiview (which i want to use in many places in my project..)
Thank you ..