[NSString stringWithFormat:]
将 C 字符串传递给with后,我可以释放它%s
吗?例如:
char *str = malloc(...);
// ... populate str ...
NSString *message = [NSString stringWithFormat:@"[%s]", str];
free(str); // should this be here, or after I'm done with message?
[NSString stringWithFormat:]
将 C 字符串传递给with后,我可以释放它%s
吗?例如:
char *str = malloc(...);
// ... populate str ...
NSString *message = [NSString stringWithFormat:@"[%s]", str];
free(str); // should this be here, or after I'm done with message?