0

私のクラスの1つで、私は走ることができます

UIButton *testButton = [UIButton buttonWithType:UIButtonTypeCustom];
NSLog(@"testButton's titleLabel is %@", testButton.titleLabel);

そして、それは問題なく titleLabel を出力します:

2013-02-26 19:11:49.223 Facebook[82876:c07] testButton's titleLabel is <UIButtonLabel: 0x1aad39f0; frame = (0 0; 0 0); clipsToBounds = YES; hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x1aad3a90>>

ただし、テスト中のクラスではEXC_BAD_ACCESS、同じ 2 行のコードを使用しているにもかかわらず、testButton の titleLabel にアクセスしようとするとエラーが発生します。

何か案は?

4

0 に答える 0