Nar*_*rwe 3 memory-management objective-c 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
Run Code Online (Sandbox Code Playgroud)
我的计数不应该是零吗?'release'不会从数组中删除所有元素吗?
| 归档时间: |
|
| 查看次数: |
39 次 |
| 最近记录: |