Just contacted iOS and spent some time looking at my base part of OC after
Just want to try to get a small program, so see http://www.cnblogs.com/LooDo/p/3907064.html blog post small program, Bo Master analysis is very detailed, oneself also want to practiced hand try, met
Application windows is expected to has a root view controller at the end of application launch
This problem, has been debugging code.
Reason for the blame:
The version of Xcode used by bloggers is version 4.2, and I'm a novice to buy Mac Pro with Xcode naturally also the latest 5.1 version.
Xcode 4.2 No longer supports window-based application templates for creating projects. Resulting in a newly created project in the Mainwindow.xib file The window cannot be associated with the socket variable window in the delegate. So the program runs, debugging when the value of the variable window is always empty, the following is the workaround. Follow the steps below to make the program available for debugging.
1.ctrl+n, create the window below the User Interface (select Ios->user interface->window), and name it mainwindow.xib.
2.File owner modified into uiapplication. (that is, bring up the show Identity Inspector panel and change the class of the file's owner to uiapplication in the custom class.) )
4. From the library, drag an object to add, and modify the class for the delegate class, the first automatic generation of that. (The class of the newly added object will be changed to Appdelegate)
5. Add Iboutlet to the attribute window declaration of the delegate class to connect to IB. (Appdelegate UIWindow attribute is marked as Iboutlet in the future)
namely @property (strong,nonatomic) UIWindow *window; modified to: @property (strong, nonatomic) Iboutlet UIWindow *window;
Then, set the delegate of the Mainwindow.xib Fileowner to your appdelegate. Fileowner delegate and Appdelegate (Object) connection: (blue link)
Connect the window to the outlet in your appdelegate:
That is, the Appdelegate outlets and window are connected together.
6. (As you can see, there is already a Window object, this window object is the iphone's screen.) ) to connect the Window property to the window that appears by default in IB.
7. Key one step, open the project properties, in summary below the main interface inside choose MainWindow finished.