新Xcode項目中的MainWindow.xib在哪里?

[英]Where is MainWindow.xib in new Xcode project?


I started a new project in Xcode 4 using the TabBar template. I noticed that there was no MainWindow.xib file in the project.

我使用TabBar模板在Xcode 4中啟動了一個新項目。我注意到項目中沒有MainWindow.xib文件。

  • Did Apple get rid of this file?
  • Apple沒有擺脫這個文件嗎?

  • How can I access the Mainwindow without this file?
  • 如何在沒有此文件的情況下訪問Mainwindow?

5 个解决方案

#1


4  

MainWindow.xib was kind of superfluous to begin with, keeping in mind that it doesn't really contain any "visible" components (thinking of the window as an invisible container) and that usually you don't need to modify it. (That said, I'm only a beginner in iOS development myself, so I would appreciate my observation being corrected if I'm wrong).

MainWindow.xib開頭是多余的,請記住它並不真正包含任何“可見”組件(將窗口視為一個不可見的容器),通常你不需要修改它。 (也就是說,我自己只是iOS開發的初學者,所以如果我錯了,我會很感激我的觀察得到糾正)。

MainWindow.xib's role in the beta version has been replaced by code: compare the auto-generated (-)application:didFinishLaunchingWithOptions: of the same template in the current and beta version of Xcode, and you should be able to follow what's happening.

MainWindow.xib在測試版中的角色已經被代碼所取代:比較當前版本和測試版Xcode中相同模板的自動生成( - )應用程序:didFinishLaunchingWithOptions:您應該能夠了解正在發生的事情。

#2


2  

If you are using the iOS SDK beta please read the release notes and the "What's new in iOS" document. You can find the documents on developer.apple.com when logged in as an iOS Developer Program member.

如果您使用的是iOS SDK測試版,請閱讀發行說明和“iOS中的新功能”文檔。當您以iOS Developer Program成員身份登錄時,可以在developer.apple.com上找到這些文檔。

#3


0  

I just created a blank tab bar project in Xcode 4 and the MainWindow.xib is there. Maybe you deleted it by accident. Try creating a new project from scratch, it should be there.

我剛剛在Xcode 4中創建了一個空白的標簽欄項目,MainWindow.xib就在那里。也許你是偶然刪除它。嘗試從頭開始創建一個新項目,它應該在那里。

#4


0  

There's a nice video tutorial on Youtube explaining how to re-create MainWindow.xib from scratch:

在Youtube上有一個很好的視頻教程,解釋了如何從頭開始重新創建MainWindow.xib:

http://www.youtube.com/watch?v=sROdA4w4x9Y

#5


0  

For the reason of MainWindow.xib been missed, you can refer to this answer. And you can refer to Is a MainWindow.xib truly needed in iOS application? for more discussion.

由於錯過了MainWindow.xib,您可以參考這個答案。您可以參考iOS應用程序中真正需要的MainWindow.xib嗎?進一步討論。

In fact, you need not a MainWindows.xib. You can look up the implementation code of your AppDelegate class's method:

實際上,您不需要MainWindows.xib。您可以查找AppDelegate類的方法的實現代碼:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

which will tell you how you xib files are loaded and connected to the window.

它將告訴您如何加載xib文件並將其連接到窗口。

And you should look up your main.m, you will find code like this

你應該查看你的main.m,你會找到這樣的代碼

UIApplicationMain(argc, argv, nil, @"MyAppDelegateClassName");

or

UIApplicationMain(argc, argv, nil, NSStringFromClass([myAppDelegate class]));

rather than

UIApplicationMain(argc, argv, nil, nil);

This statement make your AppDelegate loaded.

此語句使您的AppDelegate加載。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2011/06/22/72512476232579c74443b8f10c6ae8c6.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com