Search code examples
iphoneobjective-cnsstringnsarray

How to convert NSArray into NSString


How to convert NSArray into NSString in objective-c?


Solution

  • Bearing in mind that you don't say what's in the NSArray, you can do this:

    NSArray *arr = [NSArray arrayWithObjects: @"foo", @"bar", @"baz"];
    [arr componentsJoinedByString: @","]