iphone - How to convert NSMutableArray value to NSString? -
i have nsmutablearray named *total , uilabel *lbltotal. got result value looping. want set value uilabel in viewdidload. how can fix this?
here code using.
for(int counter = 0; counter < [node childcount]; counter++) { if ([[[node childatindex:counter] name] isequaltostring:@"total"]){ nsstring *str = [[node childatindex:counter] stringvalue]; [total addobject:str]; nslog(@"grand total %@", total); } } simply want set result value in nsstring lbltotal.text = total.
nsarray *array1 = [nsarray arraywithobjects:@"one", @"two", @"three", nil]; nsstring *joinedstring = [array1 componentsjoinedbystring:@","]; componentsjoinedbystring: join components in array specified string , return string representation of array.
to set value on uilabel
uilabel *label = [[uilabel alloc] init]; [label settext:joinedstring];
Comments
Post a Comment