I have a strange problem because "addObject" is working to add an NSString but not to add an NSArray:
NSMutableString *starCatalogEntryValue = [[NSMutableString alloc] init]; // a single string from a catalog
NSMutableArray *starCatalogEntryData = [[NSMutableArray alloc] init]; // array of strings
NSMutableArray *starCatalogData = [[NSMutableArray alloc] init]; // array of arrays
loop i times {
[starCatalogEntryData removeAllObjects];
loop j times {
[starCatalogEntryData addObject:starCatalogEntryValue]; // This works
}
[starCatalogData addObject:starCatalogEntryData]; // This does not work
}
Actually, adding the array starCatalogEntryData works but not properly. I end up with i entries in starCatalogData but they are all equal to the last value of starCatalogEntryData.