Using custom controls with Interface Builder
I have a custom ViewController which allows selection of an image from a grid. The ViewController uses the AQGrid control and is really just a modified version of the samples shipped with AQGrid.
I'm trying to hook it up in InterfaceBuilder, but documentation on开发者_运维知识库 how to do this seems sparse. In standard Cocoa apparently I should create an IB plugin to use with IB, but I'm just looking for the quickest option really as there are a few of these custom ViewControllers which I need to hook up (including a rating control). I've also tried dragging the "Object" controller in IB to my tabpage, but it just gets added to the tree outside of the tabcontroller (see screenshot).
As far as I understand your question, you have to add a generic UIViewController
to your nib file and then change its class in the Identity inspector to whatever you need as long as it's a subclass of UIViewController
.
Use a "Custom View" object and assign the appropriate class in the inspector's info tab. Using Interface Builder plugins isn't really advisable anymore, because Xcode 4 doesn't support them.
精彩评论