How to convert elements of NSMutableArray to NSString

前端 未结 3 1201
广开言路
广开言路 2021-01-21 15:05

I have 1 NSMutableArray and I want to convert whatever data in array will be in NSString. tell me code for that. Array is nothing but object of NSMutableArray class.

3条回答
  •  不要未来只要你来
    2021-01-21 15:47

    It depends on how do you want to use that string.

    One way to convert an object to a string is to call -description (or -descriptionWithLocale:) on that object. For NSArray (or NSMutableArray) -description method returns a string that represents the contents of the receiver, formatted as a property list. The result you'll get will also depend on how -description method implemented in objects in array.

提交回复
热议问题