i have a nsmutablearray which have 5 objects.
for example if it contain objects like apple, cat , ball, dog ,ant, i want them to append with comma separated that is like apple, cat , ball, dog ,ant. please help me with this.
edit
publishingpost //nsmutable array contains all these object
-(ibaction)post
{
nsstring *str;
nsstring *str2 =@",";
for(int i = 0; i< [publishingpost count]; i++){
nsstring *str = [publishingpost objectAtIndex:i];
//append both str1, str2 to generate comma separated objects
}
use
- (NSString *)componentsJoinedByString:(NSString *)separatorinstead: