ios - How can I show all of objects in NSMutable Array on text field? -


i want show objects in mutable array on textfield, label, else except nslog

   - (ibaction)purchasepressed:(id)sender { nsmutablearray *additem = [[nsmutablearray alloc] init]; [additem addobject:@"almond"]; [additem addobject:@"choc"]; 

"number" label (i'm not sure of objects in mutablearray can showed on textfield or not?) can nslog.

for (i = 0;i < [additem count] ; i++ ) {    nslog(@"%@", additem);     nsstring *test1=(@"%@", additem);     number.text=test1; } 

every time set text of label replace previous text.

try replacing whole loop like:

number.text = [additem componentsjoinedbystring:@", "]; 

which create single string of strings in array , add label. similar in loop if want to.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

html - Repeat image to extend header to fill screen -

javascript - Backbone.js getting target attribute -