How do I join an NSSet's elements to create an NSString?
If I have an NSSet
of NSString
objects, how can I joi开发者_JAVA技巧n them together to create a single NSString
?
NSSet
's -allObjects
method will return an NSArray
of objects in the receiver.
So, knowing this, it's pretty simple:
[[set allObjects] componentsJoinedByString:@" "];
精彩评论