开发者

Autorelease NSString

A开发者_JAVA技巧m I responsible for releasing this string, and is it autorelease by default?

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


Autoreleased by default.


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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜