title: iphone UINavigation Controller
body: <p>I'm trying to get a better understanding of the UINavigationController. I have 3 .xibs. From .xib1 I am pushing to .xib2. I have to pass data to .xib2 from .xib1.</p>
  
  <pre><code>Controller1 *selectcity = [[Controller1 alloc]initWithNibName:@"Controller1" bundle:nil];   
  
  selectcity.item1 = @"hi";
  // Push the next view onto our stack
  [self.navigationController pushViewController:selectcity animated:YES];
  [selectcity release];
  </code></pre>
  
  <p>I need to pass some data to .xib2 every time it opens that view. Pushing a new view onto the stack every time the user selects a row in the table, and then pressing back, selecting a row, back, selecting a row, back is creating a memoryWarning very quickly and killing the app. </p>
  
  <p>If I add the view as a property and check if it already exists, </p>
  
  <pre><code>if (xib2 == nil) {
  
  }
  </code></pre>
  
  <p>the viewDidLoad method only gets called the first time the view is called so I can't pass my data to the form. </p>
  
  <p>I can't use viewDidAppear etc. because I don't want to the data to load when coming back from .xib3. </p>
  
  <p>What is the correct way to control memory in this situation? Should I be popping xib2 from the stack every time they press the back button? Is so, what method would I do this?</p>
  
  <p>Thanks for any help!</p>