appendString
is a void
method; you are probably looking for
reportString = [NSMutableString string];
[reportString appendString:[reportFieldNames objectAtIndex:index]];
You can avoid append
altogether by combining it with the initialization:
reportString = [NSMutableString stringWithString:[reportFieldNames objectAtIndex:index]];
Note that there is another appending method of NSString
that requires an assignment:
NSString *str = @"Hello";
str = [str stringByAppendingString:@", world!"];