Accessibility in Interface Builder in Xcode 4.3 - interface-builder

I was wondering if anyone knows where the accessibility view in Xcode 4.3 is?
This is what I see in my IB; no tab for accessibility.

EDIT:
UITableView doesn't have an accessibility drop down because the items inside it (the cell, or actually the label and the buttons and whatever else you put into a custom table view cell) will be the accessibility items the user is looking for.
Original answer:
The accessibility label is available on many various UIView subclassed objects (such as controls like buttons).
If you're looking at the detail for any object in XCode 4's XIB / Interface Builder editor, you'll see a drop down field that looks like the below:

Related

Cocoa Image Picker Popover

Several places in OS X (in this example, the Users & Groups pane in System Preferences) have circular image views that allow the user to either drag in an image, like in an editable NSImageView but also allow them to click to show a popover that allows various other choices of image sources.
I have checked the ImageKit framework, but the only thing I found similar is the image taking sheet.
How can I make use of this feature in my own Cocoa applications? I'd imagine it is implemented in some standard framework—but any pointers on implementing something like this would be quite appreciated.
You will have to go down the custom control root as this is not available as a stand alone control.
However you have all the prerequisites.
The circular image view
There a several ways to implement this. You could try using a standard Cocoa button and customise as needed. Although it might just be easier to build from scratch by subclassing NSView. This was you can avoid all the NSCell stuff. I would do the latter.
The popover
Roll your own master-details type view controller to be displayed as the popover's content. In the left have a NSTableView (the master), the right have a NSCollectionView (the details). Below the collection view add some buttons.

In Xcode Interface Builder how do I control how the element behave when the view is resized?

In older Xcode I have a little window where I could mark braces and band things to control how a NSView behaves when its parent is resized. In the new Xcode that is missing and the controls are doing whatever they feel like.
Is there any way to get this control back? (current version: Version 4.3.2 (4E2002))
Starting with Xcode 4.3 when you create a Cocoa application project, the xib file uses auto layout. Auto layout replaces the size inspector's autosizing mask.
If you want to use the autosizing mask, the solution is to turn off auto layout. Select the xib file from the project navigator, open the file inspector, and deselect the Use Auto Layout checkbox.
Read Constraints Express Relationships Between Views to learn how views are constrained in Xcode 4. In fact, you probably want the entire Cocoa Auto Layout Guide.
Briefly, when you add a view to your view hierarchy, it comes with some constraints. Select the view in the and you'll see some blue lines that look a bit like I-beams -- these represent the constraints. Click on one of them and you can edit its properties in the attributes inspector. But how you should set the attributes probably won't make much sense until you've read about how constraints work in the document linked above.

'Embed Objects In' menu items are all disabled. How to enable?

I'm following the instructions for creating a ScrollView in the book 'Cocoa Programming for Mac OS X, 3rd Edition'. I'm using Xcode 3.2.3.
I've already created a view, into which I've drawn shapes and lines.
The next task is to convert this to a NSScrollView, which according to the book should be a simple case of selecting the existing view and choosing Layout -> Embed Objects In -> Scroll View.
However whatever object I select, the items in the 'Embed Objects In' menu are all disabled.
How can I enable the Embed Objects In -> Scroll View item?
Got it. The important thing here is not to try selecting the view in the MainMenu.xib window. Select the view in the actual document window and make sure the resize handles are visible. A little fiddly, but once you get the right object selected, then the embed objects menu items become enabled.

NSTextField with automatic NSNumberFormatter in Interface Builder

I've been making iOS apps for awhile, but I'm trying my hand at MacOS development. I'm adding an NSTextField to my UI and I noticed in Xcode that one of the options in the graphical widgets is "NSTextField with NSNumberFormatter" which implies to me that I'll be able to restrict the input of the field to numbers and configure the formatter in some way.
When I add the NSTextField with NSNumberFormatter to my UI, I can see it has a formatter outlet which appears to be kind of linked to an NSNumberFormatter (although the name is a little grayed out). However, I can't figure out any way to interact with or configure that NSNumberFormatter.
Any help?
To access the NSNumberFormatter, you have to select it in the dock (that list of objects on the left side of the XCode 4 Interface Builder [IB] window).
If the dock isn't in outline view, e.g., it just shows about 4 icons, click the triangle-in-a-square-button at the bottom of the dock. The dock should now show a "Placeholders" section and an "Objects" section; the objects are your UI objects in a hierarchical outline view.
In the IB window, click your NSTextField; that'll highlight the corresponding Text Field Cell in the outline (you may have to twiddle down some disclosure triangles to see it). The Text Field Cell should have a disclosure triangle; twiddle it down to reveal the Number Formatter. Select it, and you should now be able to manipulate it in the Inspector panel.
(There are a lot of things non-obvious like that in XCode. When in doubt, examine your UI object in the Dock's outline view, or prowl the menus with that object selected. It's amazing--and often useful--what you can discover lurking there!
to configure the number formatter, you can ( after you've selected the formatter ) open the Attributes inspector, select the behavior you want and customize the formatter. At least that worked for me in XCode 4.
– moritz

How to access an NSNumberFormatter in a text field cell?

In XCode 3.2.x's Interface Builder this was simple enough, selecting the text cell displayed a small icon for the formatter that could be selected to configure the formatter in the attributes pane.
Now in XCode 4, the formatter icon is gone! If I drag an instance of NSTextField with an NSTextFormatter from the library OR drop and NSTextFormatter into an existing cell there is no way I can figure out to select the formatter to configure it!
Add to this the fact that Core Data entities UI prototype assistant was removed and I would say IB integration into XC4 is half baked at best!
Any luck with this anyone?
you can access the formatter from the jump bar at the top of the window. if you select the component you added the formatter to, click and hold and it will turn into a drop down menu. move to the sub menu and the formatter should show up where you can select it.
it seems that you can treat the whole ui like a cascading set of menus that way.
now removing the formatter, that's a different question...
... which after further looking revealed:
over on the left side of the IB window in xcode4 is a 'dock' containing the icons for file owner, first responder etc. this column is expandable, and when you do so will show a hierarchical view of the nib file. through which you can navigate like the finder.
also, see this article:
http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/InterfaceBuilder/InterfaceBuilder.html%23//apple_ref/doc/uid/TP40010215-CH6-SW3

Resources