3
有人可以向我解釋下面的結果嗎?釋放NSMutableArray不影響數組中元素的數量
//generate an array with 4 objects
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects:
[NSNumber numberWithInt:1],
[NSNumber numberWithInt:2],
[NSNumber numberWithInt:3],
[NSNumber numberWithInt:4],
nil];
//release the array
[array release];
//get a count of the number of elements in the array
int count = [array count]; <--- count returns 4
我的計數不應爲零嗎? '釋放'不會從陣列中刪除所有元素嗎?