我有一些關於autorelease功能的問題。它是否有任何意義或價值調用保留或釋放自動釋放對象?
請諮詢..
Q1)是否有任何關於呼籲保留或釋放到自動釋放對象的意義或價值?
ex1)
UIView *viewTest = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 400)] autorelease];
[self.view addSubview:viewTest];
在這種情況下,viewtest對象將來會被釋放嗎? 或者需要添加一行'[viewTest release];'?
EX2)
UIView *viewTest = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 400)] autorelease];
[viewTest release];
在這種情況下,viewTest將自動釋放? Q2)自毀對象在哪裏銷燬?