iOS 4 애플리케이션을 개발 중입니다.IBOutlets 속성. 출시 또는 출시하지 않음
@interface BlogViewController : UIViewController
{
...
UIView* tabBar;
}
@property (nonatomic, retain) IBOutlet UIView* tabBar;
및 구현 :
이및 구현 :
@implementation BlogViewController
@synthesize tabBar;
- (void) dealloc
{
...
[super dealloc];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.tabBar = nil;
}
내 질문에 내가 IBOutlet
재산이있는 경우, 그것은 필요가를 선언하는
나는이의 ViewController가 UIView
이 마음에 드십니까?
@interface BlogViewController : UIViewController
{
...
UIView* tabBar;
}
내가 할 경우 dealloc
에 게시해야합니까?
- (void) dealloc
{
...
[tabBar release];
[super dealloc];
}
확인. 그래서 IBOutlet을 속성으로 만 사용한다면 다른 것을 할 필요가 없습니다 ('- (void) viewDidUnload; 만), 맞습니까? 귀하의 답변에 감사드립니다. – VansFannel
그것은 당신이 속성'retain' 메모리 속성을 주었기 때문입니다. 당신은 dealloc 또는'viewDidUnload'에 대한 릴리즈의 값을 유지하는 균형을 유지해야합니다. 'assign' 속성을 사용하면 그럴 필요가 없습니다. –
'dealloc' 또는'viewDidUnload'? 우리가'viewDidUnload'에서 release한다면'dealloc'에 그럴 필요가 없다는 뜻입니까? –