I have an application with many views. Whenever I click the next button on the first view I present the second view. Currently I am doing this as follows:
NextView *second = [[NextView alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:second animated:YES];
In this application, however, I don't need to keep any information from the first view any more. Is there some way I can bring up the second view, and deallocate the first view from memory? I was thinking that if I bring up 5 views in a row, and all of them are modal, then I will be using more memory that I really need. If the user hits the back button, I would also like to open the first view, and remove the second from memory.
Is there some way to do this to save memory, or is this memory just something I should not worry about?