Sad to say, I inadvertently deleted one menu item in my application. It’s not being used right now but I am thinking I might play around with that item in the days to come.
How do I restore a deleted menu item in Xcode? Or, how can I create a new menu item (that would replace the one that I lost).
Many thanks for the tip.
What menu item did you delete?
It’s the menu item “Preferences” just under the About “Application” item in my app.
It does not seem to affect the function of my app so I did not think it is that critical. However, as I said I might play around with using it to activate a window where users can set their preferences in my application.
I am sure if it can be deleted, there must be a way to put it back in. May be I have to play around with menu item instances. Just a thought.
Now, how can I put back that menu item?
You can just drag a new menu item there, give it the title “Preferences…”, and assign it the comma key as the assigned key command. By default, the Preferences item isn’t connected to any methods.
OK, I will try your suggestion.
It should work I think. If it doesn’t, I will let you know.
Thanks a lot.
Mikey-san, your tip worked just to let you know. However, I would like to post here a little clarification for those who are not familiar (just like me) or hasn’t had this problem before. I understood your tip but I had do some fiddling around to get it done.
To add a menu item in the IB, look for the item “menu item” in the Cocoa menus. It’s the class of objects just to the right of the Automator in the IB Palette. After clicking it, look for the item “Item” just below the item “Submenu”. This item “Item” is the one that should be dragged to the “Application” menu in the IB as Mikey-san posted earlier. The application should now show the additional menu item “Item” (default name). Proceeding further, just change the name of the menu item in its Attribute Pane and add the key command for it. That’s it!
Hey, I learned something today. Many thanks, Mikey-san.
There is no item “menu item” to look for.
Just look for “Cocoa menus” in the IB Palette window. Then proceed further as I posted above.