I am programmatically creating a view in the loadView method of my view controller. As follows:

-(void)loadView {

HPSFormView* viewForThisController = [ [ HPSFormView alloc ] initWithFrame:CGRectZero ] ;
viewForThisController.controller = self; // Set a reference back to this controller so the View knows who to delegate stuff to when > adding controls
self.view = viewForThisController; // Set the view for this controller to be the main menu view

}

I follow this technique for three different pairs of view controllers and views. I am pushing the view controllers onto a UINavigationController stack. Each view contains a button that uses push. As follows:

I do not have any code in viewDidLoad - indeed, it is entirely absent from my view controllers.

Everything works fine, but when I do a Simulate Memory Warning within the iOS simulator then the app crashes. I believe the problem lies with the way that I am defining my view as a 'local' variable within loadView.