Maybe this will be obviously simple for most of you, but could you please give an example how to create similar methods (in Objective-C) and functions in C to create functions like NSString
's stringWithFormat:
, or NSLog()
.
Just to remind:
[NSString stringWithFormat:@"example tekst %i %@ %.2f", 122, @"sth", 3.1415"];
NSLog(@"account ID %i email %@", accountID, email);
I'd like to create the similar to NSString
's method stringWithFormat:
, NSURL - urlWithFormat
.
Copyright Notice:Content Author:「Chris Rutkowski」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/4804674/how-to-create-variable-argument-methods-in-objective-c