Hello ! Every on here.
I was just confusing a little bit for the following issue.
I have coding in my project as follow.
I am adding view controllers' view to the each cell of table view. let me explain how...
An array, like these
NSMutableArray *arrTbl=[[NSMutableArray alloc] init];
NSMutableDictionary *dOne=[[NSMutableDictionary alloc] init];
myViewController *objVCtr=[[myViewController alloc] initWithNibName:@"myViewController" bundle:nil];
[dOne setValue:objVCtr forKey:@"cellVCtr"];
NSMutableDictionary *dTwo=[[NSMutableDictionary alloc] init];
myViewController *objVCtr1=[[myViewController alloc] initWithNibName:@"myViewController" bundle:nil];
[dOne setValue:objVCtr1 forKey:@"cellVCtr"];
NSMutableDictionary *dThree=[[NSMutableDictionary alloc] init];
myViewController *objVCtr2=[[myViewController alloc] initWithNibName:@"myViewController" bundle:nil];
[dOne setValue:objVCtr2 forKey:@"cellVCtr"];
[arrTbl addObjectsFromArray:[NSArray arrayWithObjects:dOne,dTwo,dThree,nil]];
Now, the question is, how to release this???
arrTbl is main array having dictionaries & dictionaries having ref of view controllers.
So, Should I write following statements after above statements?
[dOne release];
[dTwo release];
[dThree release];
[objVCtr release];
[objVCtr1 release];
[objVCtr2 release];
After writing above code, array can point to the view controllers or not?
Ok. Let me clear again?
The question is
- What does actually dictionary contain? (Is it retain count of View controllers or just reference of view controllers)
- What does array actually contain? (Is it retain count of dictionaries or just reference of dictionaries?)
- here I just want to have an array of view controllers & each view controllers with different values (for that I am adding dictionary to an array)
Thanks in advance for sharing your knowledge.
Sagar