Multiple Views

Apprentice
Posts: 17
Joined: 2010.01
Post: #1
:\What am I doing wrong!!! I have 3 view controller class and each one has it's own XIB. I have added a UIViewcontroller to each XIB file so that I can switch between them using this code:

Code:
Small_Animals *secondViewController = [[Small_Animals alloc] initWithNibName:@"Small Animals" bundle:nil];
self.smallAnimals = secondViewController;
[secondViewController release];


[self presentModalViewController:self.smallAnimals animated:YES];
And this code to go back:

Code:
[self.parentViewController dismissModalViewControllerAnimated:YES];

So in doing this I put an NSLog statement in my dealloc methods in each view controller class, to see if these methods were being invoked, and every time I launch the app it invokes the second view controllers dealloc method, and then upon switching to the second view controller it invokes the 3rd view controllers dealloc method, and never invokes the first view controllers dealloc method! Please, what am I doing wrong?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Using Multiple Views Jerm #1 1 2,380 Feb 4, 2010 05:26 AM
Last Post: maximile
  Advice regarding Views & Touches for iPhone game Elphaba 5 3,177 Jul 17, 2009 01:54 PM
Last Post: Frank C.
  Navigation of views in view base application trygametest 0 2,138 Feb 20, 2009 06:12 AM
Last Post: trygametest