If I have this string:
NSString *fileContent = [[NSString alloc] initWithContentsOfFile:groupPath];
…which has this content (from the path):
a, b, c, d,
…how can I populate the array with the above objects??
I tried:
self.itemArray = [[NSMutableArray alloc]init];
[itemArray initWithObjects:fileContent, nil];
…the aim is to get:
[itemArray initWithObjects:a, b, c, d, nil];
If the string is delimited with
", ", thecomponentsSeparatedByString:method inNSStringis what you want. So you’d have something like: