12345
12345

Reputation: 157

how to concatenate selected table view strings in ios

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

Answers (1)

Anusha Kottiyal
Anusha Kottiyal

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

Related Questions