Guys: Please help. I have a utility class to return a NSString with encoding. Like this:
/*Get a NSString with chinese encoding*/
+(NSString*) getGBKString:(void *)buffer
{
NSString* string = [[[NSString alloc]
initWithBytes:buffer
length:sizeof(buffer)
encoding:kCFStringEncodingGB_18030_2000]
autorelease];
return string;
}
Here the autorelease
is the right thing to do?
If so, the method caller should call retain incase the NSString object is released?