In View Controller.m
@interface ViewController ()
{
CustomView *view;
}
@implementation ViewController
-(void)viewDidLoad {
[super viewDidLoad];
view = nil;
view = [[CustomView alloc]init];
[self.view addSubview:view];
}
CustomView.m 内
-(CustomView *)init
{
CustomView *result = nil;
result = [[[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:self options:nil] objectAtIndex:0];
return result;
}
カスタム ビューに 2 つのボタンがあります。カスタム ビューは正常に読み込まれましたが、CustomView.m ファイルで ARC を有効にするとボタン アクションが起動しません。ARC を無効にすると、ボタン アクションが起動します…</p>
どこが間違っているのか..
それはuiviewのペン先をロードする正しい方法ですか(プロジェクトの多くの場所で使用したい..)
ありがとうございました ..