iOS Never reaching DidApplicationFinishLaunching.. never shows view
I am confused, I have an iOS app targeted for Iphone
The MainWindow.xib file has its Window and a VIEW that is set up to load from another XIB file
The WINDOW in MainWindow.xib has not outlets connected at all.
This was all working before, and suddenly stopped so I am assuming something in the XIB's is now off (references, delegates, something isn't linked right).
The View has its App Delegate connected to the viewController class for itself.
When the application now launches, it just shows an empty WINDOW, and the DidApplicationFinishLaunching in my AppDelegate Class NEVER gets called.
I assume I have something missing/broken in the associations of the Window and the app delegate or views..
The View is an instance of myViewController and AppDelegate is set to myAppDelegate
Yet no ma开发者_Python百科tter how I link things up with delegate outlets etc it just sits there with a blank window mocking me.
I know I screwed up something, since this all worked beautifully up until InterfaceBuilder decided to hork something.
Any Help is greatly appreciated.
The View has its App Delegate connected to the viewController class for itself.
Errr this sentence does not mean anything. A view does not have an AppDelegate.
The object that we usually call "the AppDelegate" is the object that we set as the Delegate for the UIApplication singleton object.
When your application starts, the application:didFinishLaunchingWithOptions:
method of your AppDelegate is not called by magic: it is called because this object (of type YourAppName_AppDelegate) is set as the delegate of your UIApplication object ; this connection is done in your MainWindow XIB file by connecting the "delegate" IBOutlet of the UIApplication instance to the YourAppName_AppDelegate object.
I guess for your case this connection between the app singleton's delegate outlet and the AppDelegate object implementing didFinishLaunching
is broken and needs to be redone.
Note that in the special case of the MainWindow.XIB file, as this XIB is the one automatically opened when your application starts (except if you change this in your Info.plist file), the File's Owner of this XIB is also the UIApplication singleton, so that you can connect either the File's Owner delegate IBOutlet or the UIApplication object delegate in your XIB, as this is the same singleton object.
精彩评论