Reputation: 157
How can I concatenate selected row data from a tableview and store it in an nsstring?
I have taken selected rows with a check mark and individually printed them in the Log. But after selecting 2 or 3 rows, how can I concatenate those strings?
Upvotes: 0
Views: 119
Reputation: 3905
Try this,
In .h
NSString *yourString;
In .m initialize your string in viewDidLoad ,
yourString = @"";
In didSelectRowAtIndexPath
Method
yourString = [yourString stringByAppendingFormat:@"%@",newString];
Upvotes: 1