dontWatchMyProfile
dontWatchMyProfile

Reputation: 46330

How to provide an own UIWindow subclass as the main window in an iPhone app?

For inspecting all events posted to the views of the window, I want to make a subclass of UIWindow and make that -keyAndVisible in the app delegate.

However, my project already came with an nasty MainWindow.xib file ;-) so I find it hard to do that now, since that nib guy is creating the window. Is there any way I can get rid of this MainWindow.xib? Or is there another way to have an subclass of UIWindow in place?

Upvotes: 1

Views: 1202

Answers (2)

Marco
Marco

Reputation: 340

Or in Interface Builder you can change the Window's class from UIWindow to your subclass in MainWindow.xib (using the Identity Inspector).

Upvotes: 7

jamone
jamone

Reputation: 17421

Just delete MainWindow.xib remove refrences from info.plist and your app delegate. Then you can create an instance of your custom window in the app delegate and call keyAndVisible like the app delegate currently does.

Upvotes: 1

Related Questions