I can't believe I am stuck on this!

Joined
Jul 2, 2013
Messages
653
Reaction score
12
Points
18
Location
southern Arizona
Your Mac's Specs
2018 MacBook Pro, 15", i9, 32GB RAM, Monterey
I am a retired and decided to spend some of my time learning Xcode, Objective-c and Swift and writing some apps for my own use at home. I had been developing apps for Windows using Visual Studio and (mostly) c, c# and c++ and thought Xcode and Swift would not be too much of a problem. Mostly this has worked and I have been able to develop the apps I wanted using the UI builder in Xcode (rather than in code itself). However, since most of these are relatively simple and straight-forward they have not required menus and so up until this week I never tried to attach a menu to the apps.

However, this week I decided to combine some of my apps into a single general purpose app and wanted to attach a menu, but can not see how to include the menu in the app. I have tried everything I can think of, trying to drag the menu to the app, creating Outlets and Actions in the code for the menu, modifying the menu, adding and deleting entries, but nothing serves to add the menu to the app and I get the single simple app window with no menus.

I have searched the internet for a solution, but without luck. I thought I might just buy one of the Xcode books available in Kindle form, but most of those seem to be aimed at teaching Objective-c or Swift, or are written for much earlier versions of Xcode. Can someone please tell me how to get Xcode to attach the menu bar to the app? Nothing I have tried so far has worked and I assume there is some simple setting or drag operation that would solve this problem. These are OS X apps, not iOS, in case that makes a difference.

Thank you.

UPDATE:

Never mind. Figured it out.
 
Last edited:

IWT


Joined
Jan 23, 2009
Messages
10,218
Reaction score
2,175
Points
113
Location
Born Scotland. Worked all over UK. Live in Wales
Your Mac's Specs
M2 Max Studio Extra, 32GB memory, 4TB, Sonoma 14.4 Apple 5K Retina Studio Monitor
Oh Mike, do tell us the solution. There will be followers of this thread with a similar problem and your solution would be very helpful to them.

Ian
 
Joined
May 21, 2012
Messages
10,703
Reaction score
1,158
Points
113
Location
Rhode Island
Your Mac's Specs
M1 Mac Studio, 11" iPad Pro 3rdGen, iPhone 13 ProMax, Watch S7, 2018 15" MBP, AirPods Pro
Oh Mike, do tell us the solution. There will be followers of this thread with a similar problem and your solution would be very helpful to them.

Ian
Until the site goes away.....
 
Joined
Oct 16, 2010
Messages
17,494
Reaction score
1,541
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan
OP
M
Joined
Jul 2, 2013
Messages
653
Reaction score
12
Points
18
Location
southern Arizona
Your Mac's Specs
2018 MacBook Pro, 15", i9, 32GB RAM, Monterey
I did not post my "solution" because I did not think it applied to anyone else on this forum.

As I mentioned I spent many years writing code for Windows machines (and Unix and proprietary machines before that) and got used to the way Windows displays information. A Windows app always keeps the menu attached to the app, so if the app is not running "maximized" the menu is still easily seen as part of the app. Apple does not work that way and it has taken some time for me to get used to that, so I just did not see that the menu was there, but detached from the app. Out of sight, out of mind, or something like that.

So the problem was operator error the entire time, and so the "solution" did not seem useful to anyone else. I need to try to remember that ...
 
Last edited:

IWT


Joined
Jan 23, 2009
Messages
10,218
Reaction score
2,175
Points
113
Location
Born Scotland. Worked all over UK. Live in Wales
Your Mac's Specs
M2 Max Studio Extra, 32GB memory, 4TB, Sonoma 14.4 Apple 5K Retina Studio Monitor
Oh, operator error! I do that all the time. Quite expert at it as a matter of fact. Nice to know there others in my club!

Good luck in the future.

Ian
 
Joined
Oct 16, 2010
Messages
17,494
Reaction score
1,541
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan
Oh, operator error! I do that all the time. Quite expert at it as a matter of fact. Nice to know there others in my club!

Ian


And someone caught and recorded the action it seems… ;D


chestnut-bud.jpg




- Patrick
======
 
Joined
Oct 29, 2016
Messages
102
Reaction score
4
Points
18
Your Mac's Specs
27-inch iMac, 3.4 GHz i5, Radeon Pro 570, 16 GB DDR4 2400 MHz, 1 TB 7200-rpm
The one thing that catches perhaps all programmers out is during those times when there's a problem and it just doesn't make any sense as to how it's possible. And the truth is, it's usually caused by a simple and very obvious human error. No matter how much we try, it's sometimes just unavoidable. But you know, some human errors might just be :p.
 
Last edited:

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top