对于语句NSString* testObject = [[NSData alloc] init];关于testObject是什么类型对象,以下说法正确的是:
答案:(A)
- 68、
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *str = [NSString stringWithFormat:@”abc”];
NSString *str2 = [str retain];
[pool release];
NSLog(@”str retainCount = %d,str2 retainCount = %d”,[str retainCount],[str2 retainCount]);
上述代码打印结果正确的是:
NSString *str = [NSString stringWithFormat:@”abc”];
NSString *str2 = [str retain];
[pool release];
NSLog(@”str retainCount = %d,str2 retainCount = %d”,[str retainCount],[str2 retainCount]);
上述代码打印结果正确的是:
答案:(C)