Friday, September 3, 2010

Back from a long absence

I've been taking a break and trying to get back into iphone development.  I decided my wall paper editor needed a navigation controller.  This turned out nastier than I thought.  XCode 4 has some problems with user interface editing, and I also forgot what I was doing.

What I had to do to retrofit a navigation controller onto my existing project.


  1. Add a navigation controller to my main window
  2. Add my main I was using as the view in the navigation controller.  You have to set both the nib and the class to your class.
  3. Add a navigation controller outlet to my application delegate.
  4. Connect my navigation controller to that outlet.
  5. Modify the main of the delegate to do the following:
[window addSubview:rootViewController.view];

where rootViewController is:
@property (nonatomic, retain) IBOutlet UINavigationController *rootViewController;

I spent more time than I care to think doing this, I would miss one step or another and things would just not work.  It was useful practice to wire the thing together, but it ate a lot of time.

No comments:

Post a Comment