3
由於在UIStoryboard編輯器中似乎沒有窗口設置,我想知道如何將AppDelegate的窗口類從UIWindow切換到其子類。iOS5:如何在UIStoryboard中設置UIWindow子類?
我經常做的是在應用程序中編寫以下代碼:didFinishLaunchingWithOptions :, 但每次它真的讓我變得遲鈍。
UIViewController* vc = self.window.rootViewController;
self.window = [[MyWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = vc;
任何想法?
感謝您的評論。我會嘗試使用Xcode的代碼片段,但我真的希望Apple能夠在UIApplicationDelegate的協議中添加類似 - (Class)windowClass的方法:( – inamiy