Ran across this NSString Addition and I hav no idea what it does or is used for?
NSString *NSStringWithFormat(NSString *formatString, ...) {
va_list args;
va_start(args, formatString);
NSString *string = [[NSString alloc] initWithFormat:formatString arguments:args];
va_end(args);
#if defined(__has_feature) && __has_feature(objc_arc)
return string;
#else
return [string autorelease];
#endif
}
It’s a C function that lets you do this:
instead of this:
or
Seems kind of pointless to me since with or without ARC you can use the “No ARC” code. This C function only saves a few characters.