21

If I have an NSSet of NSString objects, how can I join them together to create a single NSString?

Jacob Relkin
  • 161,348
  • 33
  • 346
  • 320
nfm
  • 19,689
  • 15
  • 60
  • 90

1 Answers1

48

NSSet's -allObjects method will return an NSArray of objects in the receiver.

So, knowing this, it's pretty simple:

[[set allObjects] componentsJoinedByString:@" "];
Jacob Relkin
  • 161,348
  • 33
  • 346
  • 320