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
Post a Comment