久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

應用程序窗口應該在應用程序啟動結束時有一個

Application windows are expected to have a root view controller at the end of application launch - even with all known issues fixed(應用程序窗口應該在應用程序啟動結束時有一個根視圖控制器 - 即使所有已知問題都
本文介紹了應用程序窗口應該在應用程序啟動結束時有一個根視圖控制器 - 即使所有已知問題都已修復的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我有這個問題,但是我在這個論壇或一般互聯網上找不到的信息似乎都無法幫助我.

I have this problem, however none of the information I can find on this forum or the internet in general seems to be able to help me.

似乎有兩個地方會出現此錯誤:

There seem to be two places where this error can come about:

  1. main.m - 我的函數如下所示:

  int main(int argc, char *argv[])
    {
        @autoreleasepool {
            return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
        }
    }

UIApplicationMain 中的最后一個參數返回我的 AppDelegate 類的 NSString 值.因此,這工作正常.

The last argument in UIApplicationMain returns an NSString value of the class of my AppDelegate. This is therefore working fine.

2.AppDelegate.m - 有一種舊"的方式來設置根視圖控制器,如下所示:

2.AppDelegate.m - there is an "older" way of setting the root view controller which is like this:

  [self.window addSubview:rootViewController];

但是,在我的應用中,它已經更新為:

However, in my app it has already been updated to:

self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];

因此,互聯網上的當前信息均無效.這有點令人費解,因為我的同事可以讓它在他的計算機上完美運行 - 他是向我發送應用程序源代碼的人,因此所有設置和代碼應該完全相同.

So none of the current information on the internet works. It is slightly more puzzling as my colleague can get it to work on his computer perfectly fine - he was the one that sent me the app source code so all the settings and code should be exactly the same.

我正在嘗試在模擬器中啟動它.它是針對 iOS 5 構建的,但我正在嘗試在 iOS 6.0 模擬器上運行它.

I am trying to launch this in the simulator. It is built against iOS 5, but I'm trying to run it on the iOS 6.0 simulator.

我有最新的 XCode (4.5.1).

I have the latest XCode (4.5.1).

有什么原因會發生這種情況嗎?我該如何糾正它?

Is there any reason this would be happening? And how can I rectify it?

非常感謝

湯姆

推薦答案

我在嘗試將 UITableView 添加到單視圖應用程序時遇到了完全相同的事情.相反,創建一個默認的 Master-Detail Application 項目(file->new->target->...)并查看 AppDelegate 的 didFinishLaunchingWithOptions 實現:

I ran into exactly the same thing trying to add a UITableView to a single-view app. Instead, create a default Master-Detail Application project (file->new->target->...) and see the AppDelegate's implementation of didFinishLaunchingWithOptions:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

MDMasterViewController *masterViewController = [[MDMasterViewController alloc] initWithNibName:@"MDMasterViewController" bundle:nil];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}

與其直接將視圖控制器設置為窗口的 rootViewController,不如為 initWithRootViewController 創建一個使用視圖控制器初始化的導航控制器,然后將該導航控制器設置為窗口的 rootViewController.(請注意,您還必須將導航控制器隱藏在屬性中,以免被破壞).

Rather than directly setting your view controller as the window's rootViewController, you need to create a navigation controller init'ed with your view controller for initWithRootViewController, then set that nav controller as the window's rootViewController. (Notice you also have to squirrel away that nav controller in a property so it doesn't get destructed).

這篇關于應用程序窗口應該在應用程序啟動結束時有一個根視圖控制器 - 即使所有已知問題都已修復的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Using Instruments to test an iOS app without having source code to the application(在沒有應用程序源代碼的情況下使用 Instruments 測試 iOS 應用程序)
KIF: How to auto-run/stress test an iOS app to find the cause of a rare UI bug?(KIF:如何自動運行/壓力測試 iOS 應用程序以找出罕見 UI 錯誤的原因?)
Can#39;t change target membership visibility in Xcode 4.5(無法更改 Xcode 4.5 中的目標成員身份可見性)
UITableView: Handle cell selection in a mixed cell table view static and dynamic cells(UITableView:在混合單元格表視圖靜態和動態單元格中處理單元格選擇)
How to remove Address Bar in Safari in iOS?(如何在 iOS 中刪除 Safari 中的地址欄?)
iOS 5 SDK is gone after upgrade to Xcode 4.5(升級到 Xcode 4.5 后,iOS 5 SDK 消失了)
主站蜘蛛池模板: 亚洲精品乱码久久久久久按摩观 | 午夜精品久久 | 中文字幕亚洲一区二区va在线 | 狠狠骚 | 久草成人网 | 久久精品久久精品 | 久久久www成人免费无遮挡大片 | 伊人网在线综合 | 久久久新视频 | 日韩免费一级 | 午夜免费看视频 | 国内精品视频在线观看 | 日韩免费视频一区二区 | 国产成人99久久亚洲综合精品 | 午夜一区二区三区视频 | 久色网 | 国产欧美一区二区三区日本久久久 | 精产嫩模国品一二三区 | 中文字幕一区二区三区精彩视频 | 欧美激情黄色 | 电影午夜精品一区二区三区 | av一二三区| 国产片侵犯亲女视频播放 | 国产精品久久久久久久久久久久久 | 国产精品二区三区 | 91福利影院 | 拍真实国产伦偷精品 | 在线观看视频91 | 午夜三级在线观看 | 欧美一区在线视频 | 亚洲精品视频在线观看视频 | 国产成人一区二 | 久久精品国产一区二区三区不卡 | 黄色免费网 | 欧美激情综合网 | 欧美精品一区三区 | 亚洲精品国产电影 | 午夜欧美一区二区三区在线播放 | 天堂av中文 | 国产乱码精品一区二区三区五月婷 | 四虎影音 |