I'm wondering how to set a cell's detail text using an NSArray similar to
tableData = [NSArray arrayWithObjects:@"Example", @"Example2", nil];
I'm not sure if it's possible but surely this awesome community could find something :D
I'm wondering how to set a cell's detail text using an NSArray similar to
tableData = [NSArray arrayWithObjects:@"Example", @"Example2", nil];
I'm not sure if it's possible but surely this awesome community could find something :D
Obviously you need a string to set the text. So you need to create a string from your array. A quick scan of the docs for NSArray
reveals a handy method named componentsJoinedByString:
.
NSArray *myArray = @[ ... ];
NSString *arrayText = [myArray componentsJoinedByString:@", "];
cell.detailTextLabel.text = arrayText;