这是我的代码
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *str = [[NSString alloc]initWithString:@"This is string object"];
NSLog(@"%lu", [str retainCount]);
[pool drain];
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我期望输出为1因为它是新创建的对象,但结果是1152921504606846.这里有什么问题?
| 归档时间: |
|
| 查看次数: |
177 次 |
| 最近记录: |