iOS: Concat NSString

- (NSString*)concatenateStrings:(NSString*)string, ...
    NSString* result = string;

    va_list args;

    NSString* arg;
    while((arg = va_arg(args,NSString*)))
        result = [result stringByAppendingString:arg];


    return result;
Which you would call with something like:
NSString* result = [self concatenateStrings:@"ABC",@"DEF",@"GHI",nil];
Remember to terminate the argument list with a nil.
iOS: Concat NSString iOS: Concat NSString Reviewed by Unknown on 15:13 Rating: 5

No hay comentarios:

Con la tecnología de Blogger.