开发者

How do I join an NSSet's elements to create an NSString?

开发者 https://www.devze.com 2023-03-06 03:44 出处:网络
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.

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

精彩评论

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

关注公众号