I am just starting off with iOS development. I am trying to add action to a button and it is mentioned on apple developer site that "To Control-drag, press and hold the Control key while you drag from the button to the implementation file in the assistant editor pane."
But am not able to do this. What is control key? How can i do this? When I try to add control drag, entire button is getting dragged and am not able to see any control-drag arrow. Thanks a lot for your time.
You can either click and drag with the right mouse button (if you have one), or hold down the Control key while you click and drag with your left (single) mouse button.
By "Control" key, they're referring to the Control key on your keyboard:
Related
How do I disable the Xcode auto-display feature of the utilities panel (aka the far right pane that holds the identity inspector etc)?
In full screen mode (coding, not just in the storyboard) whenever my mouse curser gets moved all the way to the right of the screen, the utilities panel displays automatically. It is distracting and unwanted. If I need that panel I can click the button in the upper right to display it, or use a keyboard shortcut. It doesn't seem like anything else is autodisplaying, just the right side panel. Once I move the mouse away from it, the panel disappears again. Maddening I tell you.
I'm TV'ing from a remote location to my mac to play around with XCode (on a windows pc). Within the interface builder, I'm trying to perform the control drag action. I tried pressing the ctrl button and dragging a view controller but nothing happens. If it's of any significant, I have send key combinations checked.
As a workaround, instead of control dragging try control clicking on the object you wanted to drag from. The black pop up box that lists the object's outlets etc will appear, and from there you can left-click drag from the circles to wherever you want.
Try the windows key, it will function similar to OSX Command key
Can confirm on Mac using TeamViewer 10.0.52680, right-click or control-click on an object on a story board and simply left-click dragging to the view controller will create the proper referencing outlet.
If you have issues with the right click, go to TeamViewer preferences on the machine you are removing from, go to Advanced > General and select "Use control and mouse click as right mouse-click". This will enable you to send the control button and left click combination to your remote machine as a right click.
I've created an interface nib/xib file. The app is basically working, which is cool. The standard toolbar buttons look bad, they're glossy and raised, while most apps in Lion have the flat, inner bevel look. So I created some image toolbar buttons and put them in the toolbar and they look great, but they're all disabled by default.
Is there a way to give these the correct state in InterfaceBuilder or do I have to use code to give them the proper state.
Cocoa and Objective C are very unfamiliar so it would be helpful to me if I just knew what to search for. Most of my searching brings me results for creating custom buttons for iOS.
I figured this out, here's what you do:
In the nib/xib file, double click your menu bar to show the "allowed toolbar items" sheet. From here, choose your button that you've created. In my case I'll select a back button that I want to connect to a webview control. Ctrl click + drag from the button to what you want to connect it to and then make the appropriate connection. In my case I choose goBack from the WebView.
Once it has a connection it now becomes active.
I am trying to interface with a cocoa popup menu from an OpenGL button. The actual button needs to be in OpenGL and I cannot stick an actual Cocoa button in its place but when this button is pressed I would like for a Cocoa menu to popup just like the one that comes up when you press the nspopupbutton. It seems that there is no way to get this popup window to come up by itself so I wanted to just insert an invisible button and have it be pressed automatically when the popup menu method is called. Is there a way to programmatically set a button to pressed (this will bring up the menu from the popupbutton) and make the button itself invisible without making the resulting menu invisible?
It seems that there is no way to get this popup window to come up by itself
Sure there is. See + popUpContextMenu:withEvent:forView:
Have you thought about just using a regular NSMenu, rather than trying to finagle the menu from an NSPopupButton?
When you press the keys for an NSMenuItem keyboard shortcut on Mac, the menu itself highlights to indicate that an action in that menu has been activated.
If you are not familiar with the effect try it now by selecting some text and while pressing CMD-C, watch the Edit menu. It will flash blue to indicate you activated a shortcut for an item in that menu.
I want to achieve the same effect programmatically, preferably without faking the keyboard entry. Thanks for your time.
Use the Accessibility framework. Find the menu item and send it an AXPress action.