How to convert NSArray into NSString

前端 未结 4 1009
北恋
北恋 2020-12-15 11:33

How to convert NSArray into NSString in objective-c?

4条回答
  •  离开以前
    2020-12-15 12:38

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

提交回复
热议问题