开发者

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:@" "];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜