Hello list, The subject says it. The procedure for making connections to IBOutlets or IBActions seems to work perfectly when I use it to hook up NSButton, NSTextField, or NSTable controls. When I do the exact same thing for NSMenuItems, though, nothing happens. I'm using VoiceOver, and so I get no visual feedback as far as lines stopping or things turning colors, and no popovers or alerts are appearing with information about the problem. In case it helps, I'll outline the procedure I'm using--again, this works unless I'm using it on a menu item.
1. Write the line of code (outlet or action) in the view controller file, then build. 2. In the ruler next to the source code, find the button corresponding to the newly created outlet/action. VO identifies this as a button, though I don't think it actually is one. The text of this supposed button is something like "IBOutlet - [outlet_name], in [file_name], not connected". 3. Put the mouse on the button (vo-cmd-f5), lock the mouse down (vo-shift-cmd-space), and move over to the storyboard (I'm assuming you have both open at once, using an assistant editor). 4. In the storyboard outline table, find the control you want to hook to the outlet/action (be sure to interact with the table). To the right of the control is an unlabeled button; once VO is on it, route the mouse there and release it (vo-shift-cmd-space again). Note that, at least from what I've been told, this button next to everything in a storyboard outline is invisible visually, only appearing to VoiceOver.
That's it. Not as easy as control-dragging, but it's the only consistent way I know of. I just tried it, right before writing this email. In the very same project, it hooked a newly added button to an outlet on the first try, and did absolutely nothing for an NSMenuItem after three attempts. Are menu items simply not treated the same as most other controls / is there a different way I should be doing this? I just want to hook menu items to actions so I can actually have them do things. I've found the delegate protocol, at
but that seems like overkill for basically the same procedure I'd use on a button. If this is the wrong list for this question, let me know; it seemed to fit equally well here and on the cocoa-dev list. Hopefully it's not off-topic. Anyway, thanks in advance for any answers. |