ストーリーボードで作成した単純な「About」ビューがあります。基本的にそれが持っているのはUITextView
. コントローラーは次のようになります。
// AboutViewController.m
#import "AboutViewController.h"
@interface AboutViewController()
@end
@implementation AboutViewController
@end
コードに丸みを帯びたコーナーを追加できるように、UITextView のアウトレットを追加したいと考えています。ストーリーボードからandの間にCtrl
+ ドラッグしてアウトレットaboutBlurbを呼び出すと、次のようになります。@interface
@end
AboutViewController.m
// AboutViewController.m
#import "AboutViewController.h"
@interface AboutViewController()
@property (weak, nonatomic) IBOutlet UITextView *aboutBlurb;
@end
@implementation AboutViewController
- (void)viewDidUnload {
[self setAboutBlurb:nil];
[super viewDidUnload];
}
@end
私の質問は、XCode がviewDidUnload
メソッドを挿入してプロパティをnil
ing するのはなぜですか? aboutBlurb
ARC では、メソッドnil
内でプロパティを指定する必要はないと考えました。viewDidUnload
さらに、Apple は iOS 6 でメソッドを完全に廃止したと思っていました。メソッドが自動生成されるviewDidUnload
合理的な理由はありviewDidUnload
ますか、それとも安全に削除できますか?