I have a for-in loop running unknown num of times, when its finished running I want to have all names appending like so: name1, name2,name3 and so on.
How do I append the strings within the loop ?
I was thinking of something like this :
if (donePressed)
{
NSString *allFriends;
selectedFriends = friendPicker.selection;
for (NSDictionary * friend in selectedFriends)
{
NSString * friendName = [friend objectForKey:@"name"];
// some built-in method that appends friendName to allFriends with a ", " between them
}
NSLog(@"%@",selectedFriends);
}