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.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Converting (u)int64_t to NSNumbers
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- “getter” keyword in @property declaration in Objec
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. ForNSArray
(orNSMutableArray
) -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.If you want only the elements of array then you can try componentsJoinedByString:. This method returns all the elements with separator string without other formatting info.
Here "," is separator string.
It depends on how you want your string. One approach could be iterate through array and convert each element of it.
You can modify the above code based on item's class.
Below code will convert Array to string with commas and other information.