5

I want to create a custom UIProperty Control that is not more than a UILabel and a UITextField grouped together and add it to IB's Custom Objects list to reuse in other Nibs. I found a lot of documentation and everything points to creating a Xcode or IB plugin project, but everything refers to Xcode 3.x and there are no parallels in many spots. Anyone cares to help?

Thank you in advance

2 Answers 2

2

Unfortunately, it's not easy, if even possible at all. Unlike Xcode 3, in XCode 4, Apple has pretty much eliminated this feature. They now say you must create the class manually first and then associate the controller object using Interface Builder.

InterfaceBuilder Docs explain how to do it now in Xcode 4 using a custom object.

And from the xcode 4 transition guide:
After adding the source file templates to your project, drag a custom view object from the library into the nib file. After adding the custom view to your nib, select the custom view and assign the correct class to it in the class field under Custom Class in the Identity inspector

Some more resources:

iphone-creating-custom-objects-for-interface-builder

Interface Builder Help - Custom Object

2
  • Just say you don't know. XCode 4 has in the IB palette an item labeled "Custom Objects". What I, and many others are looking for, is how to use this feature. I believe that is what the OP is also looking for. None of the "resources" had anything to do with that. Commented Jun 15, 2012 at 16:15
  • @Fel The OP was asking if it's possible to use this object to have the same (reusable) custom object show up in the IB palette every time you select a xib in your peoject. This hoever is not the intended functionality of the custom object in the palette. The proper way to use a custom object is to drag it into your xib (or list of objects on the left), then set its class to your custom object class via the object properties tab on the right (just type your class name in the "Class" field and the IBOutlets & IBActions will show up for that object in the IB).
    – chown
    Commented Jun 17, 2012 at 0:23
0

Xcode 4 doesn't do plugins.

Creating something that will be customizable in IB doesn't seem to be possible at this point. I think the strategy being used by and large is to avoid IB and do it all in code (e.g. most everything on cocoacontrols.com).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.