I currently have this array of NSDictionary
s in my table view, but I need to duplicate the number of dictionaries in the array as the table view scrolls down. Is there a way to achieve this, and also specify or know what the dictionary names will be?
NSMutableDictionary *d0 = [[NSMutableDictionary alloc] init];
NSMutableDictionary *d1 = [[NSMutableDictionary alloc] init];
NSMutableDictionary *d2 = [[NSMutableDictionary alloc] init];
NSMutableDictionary *d3 = [[NSMutableDictionary alloc] init];
NSMutableDictionary *d4 = [[NSMutableDictionary alloc] init];
objects = [NSMutableArray arrayWithObjects:d0, d1, d2, d3, d4, nil];
First of all, it seams to be easier to create the dictionaries in a loop:
If you want to "duplicate" the dictionaries, you can do that with a loop, too:
But I cannot get rid of the feeling that your whole approach is wrong. What is the idea behind that?