user1639968
user1639968

Reputation: 31

Can't use some UI classes in Xcode's Interface-Builder for a xib

In Xcode 4.6, I found activating Interface Builder disables the ability to choose some UI classes. For example:

  1. Make a project from template "iOS Application" > "Empty Application". I can choose "Secure Text Field" or "Combo Box" from library window. There is a listbox labeled "Object library" in library window and it contains many items under "Cocoa Touch" entry.
  2. Create a controller.m with xib and select the xib file in Project navigator to open interface builder. Then I can't choose "Secure Text Field" nor "Combo Box" from library window anymore. Now "Objects" contains only "Cocoa Touch" entry and other libs have disappeared.

I want use these UI classes in iOS applications. Is it not allowed to use them in xib file?

Upvotes: 1

Views: 234

Answers (1)

BergQuester
BergQuester

Reputation: 6187

When you do not have an xib open, the Object Library allows you to view all objects in the Library. However, when an xib is selected it only allows you to select items that are available on the platform that the xib is designated for.

The Secure Text Field and Combo Box are Mac-only controls and simply do not exist on iOS.

For the Secure Text Field, you may use a UITextField and check the Secure option in its Attributes inspector. That should cause the UITextField to behave in a similar manner to the Mac's Secure Text Field.

For the Combo Box, this item has no iOS equivalent and would need to be implemented in a custom manner. However, Combo Boxes are not easily used on touch devices. I would suggest using a Label or Text Field combined with a Picker View to achieve the equivalent effect.

Upvotes: 2

Related Questions