In my iPhone app I am developing, I have defined two windows:
@interface The_NoteAppDelegate : NSObject <UIApplicationDelegate> {
IBOutlet UIWindow *newNoteWindow;
IBOutlet UIWindow *homeWindow;
}
@property (nonatomic, retain) UIWindow *newNoteWindow;
@property (nonatomic, retain) UIWindow *homeWindow;
and they are linked correctly in IB – but how do I show/hide these windows?
[homeWindow makeKeyAndVisible]; works in appDidFinishLaunching but when I try [newNoteWindow makeKeyAndVisible]; again to open the other window (on a button touch event) in front of the other, the app freezes.
I know this is a very n00by question but please help me out 🙂
In almost every instance, you don’t want to have multiple instances of
UIWindow. Your application has its own window, and from there, you deal with views. For what you’re trying to do (as far as I can tell from your variable names), it would make sense to use aUINavigationController. Then write aUITableViewControllersubclass for your home view, and aUIViewControllersubclass for your notes view.