Autorelease NSString

我是否负责释放此字符串,是否默认为autorelease?

// command is of type NSData*
char cAddress[12];
[command getBytes:cAddress range:NSMakeRange(5,12)];
NSString *someString = [NSString stringWithCharacters:(const unichar*)cAddress length:12];

It's autoreleased by default. Retained objects are usually created with methods in the form of:

[[MyClass alloc] ...]
[MyClass new] 
[object copy]

默认情况下自动释放。

链接地址: http://www.djcxy.com/p/53274.html

上一篇: 使用点语法设置retain属性时使用autorelease?

下一篇: 自动释放NSString