Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How add data from NSMutableString into NSArray?

is it an possible to add a value from an NSMutableString into an NSArray? Whats the snippet?

like image 867
Apache Avatar asked Apr 26 '26 08:04

Apache


1 Answers

Actually, Mike is wrong. If you want to instantiate an NSArray with a single NSMutableString object, you can do the following:

NSMutableString *myString; //Assuming your string is here
NSArray *array = [NSArray arrayWithObject:myString];

There is no arrayWithElements in NSArray (see NSArray documentation)

like image 87
Adam Woś Avatar answered May 05 '26 13:05

Adam Woś



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!