Hi I'm trying to learn how to write apps for the iPhone.
I'm using a book to guide me. Unfortunately the book is written before interface builder was integrated in to Xcode.
So now I'm trying to make a simple app that switches between three view开发者_如何学Gos.
I want to connect an outlet from File's Owner to another view controller. In the book it says that I'm suppose to Control-drag from File's Owner to the view controller, in the Document window. But in the new Xcode there's only the iPhoneStoryboard and the Xib files for my other views/viewcontrollers. So how do you connect outlets between view controllers?
Could anybody please help me?
PS: the necessary code have already been written.
File's Owner is just a proxy for the object that's specified as the owner when the nib is loaded, usually either the application itself or a view controller. If you have a view controller in nib A that loads its view from nib B, then you can connect anything in nib B to the File's Owner proxy in B and it'll be connected to the view controller from A when the nib is loaded. Other than that, you can't connect objects in one nib to outlets in another. (It's possible to create other proxy objects like File's Owner, but if you were ready to do that you wouldn't be asking this question.)
精彩评论