开发者

Create instance of class in nib file

Im going through Apple's OSX Cocoa (Your First Mac Application) tutorial and am up to refactoring the app delegate. I have created my own controller class.

I don't understand how to开发者_如何学Python "Create an instance of the controller class in the nib file". I'm using Xcode 4.


Drag an 'Object' from the 'Object Library' in the right pane onto your nib. Next, select the object that you dragged into the nib, and then select the identity inspector (third icon from the left in the top right pane). From these, you can set a custom class. Set the class to be the custom controller that you have created. This will be created for you when the nib is initialized. You can then connect this to an IBOutlet in your AppDelegate (for that custom class).


I think what you want is on the inspector, click the third tab, and for the "Custom Class", select your view controller.

Create instance of class in nib file

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜