I am very new to Objective-C with Cocoa and I need help.
I have a for statement in which I loop from 1 to 18, and I would like to add an object to NSMutableArray in this loop. Right now I have:
chapterList = [[NSMutableArray alloc] initWithCapacity:18];
for (int i = 1; i<19; i++)
{
[chapterList addObject:@"Chapter"+ i];
}
I would like for him to add objects, chapter 1, chapter 2, chapter 3 ..., chapter 18. I have no idea how to do this or even if it is possible. Is there a better way? Please, help
Thanks in advance,
source
share