Xcode 6.3.2 build for OS X 10.7 - xcode

Hope you can help me with a strange problem, no clue what I am doing wrong.
On Xcode 6.3.2 I want to build an app able to run on OS X 10.7.
So I started with a new Cocoa Application (Obj-C), naming it "Test". I set the Deployment Target to 10.7. Leaving the application empty I can build and run it on my main machine (OS X 10.10.3). Running wt will show an empty window ok.
Now I archive it and in the Organizer export it as a Mac application. Again all works fine, no errors. Now if I run it on the target machine (running 10.7.5) it will start, but no window will show up. Also the menu of the app will only show its name, all other menu items are missing.
What am I doing wrong?

You probably created the project to use a storyboard, which is not supported by OS X 10.7. You need to use a MainMenu NIB. You also need to make sure you don't use any features that were introduced after 10.7.
Also, when an app fails like this, you should check the console log to see if it logged any errors. You can view that using /Applications/Utilities/Console.app.

Related

Message from debugger: unable to attach error for osx app

I have been building mac app on my mac mini and it always worked well but today i faced this error, searched a lot but no luck.
Message from debugger: unable to attach
What i tried:
Clear derived data
Quit Xcode
Restart machine
installation directory set to blank and also to /Applications
Tried Skip Install No / Yes
Using developer Signing certs
M using only Developer certificates and not provisioning profile to sign my cocoa app
Xcode 8.2
OSX 10.12.1
Please help :)
This is what fixed it for me, perhaps it will help others but I do realize the question was for 8.2. I had it set to Xcode 9 "New Build System" disabling this and switching to "Standard Build System" in the Project Settings under the File Menu. I had tried all the other things like killing DerivedData, clean build, restarting Xcode. I also verified that my dependent libraries were set correctly. The only thing that worked was disabling new "New Build System"
I just had this problem today. I have little demo code in a mac project(created with Xcode 9.4). This error just started to occur after I upgraded system to macOS Mojave 10.14. However, in Xcode 10 this project runs no problem(without changing anything). If you can use Xcode 10 it will probably be fixed.
Unfortunately, the above solutions didn't work for me (although I am sure they work for some people).
Here is what worked for me, in case this helps anyone else:
Close Xcode
Open Xcode and Create a new Xcode project
In the iOS template, select Single View App then click Next
yes, I know you are trying to get a macOS app attaching to the debugger :).
Give the iOS app any product name and organization identifier you would like and click Next
Create the new project anywhere you would like (I saved it to my desktop)
Build and run (cmd + r) the iOS app on a simulator like the iPhone 8 (starting a simulator and running the iOS app will take a little time, so have patients)
After the iOS app runs in the simulator, click to stop it from running (the stop button is next to the run button)
Open your macOS app that you are having trouble connecting a debugger to, and build and run it (cmd + r)
This, for some reason, allowed me to connect to the debugger with my macOS app...
Xcode version: 10.1, macOS Mojave version: 10.14.2

Could not connect the action buttonPressed: to target of class NSApplication when attempting to debug Mac OS X app on 10.7

I'm attempting to target 10.7 with my Mac OS X app, but when I try running it on a 10.7 machine no window opens and I get "Could not connect the action buttonPressed: to target of class NSApplication" logged to the console.
When I try to build the app locally to debug, I get "-fobc-arc is not supported on platforms using the legacy runtime". It looks like I need Xcode 5+ which isn't supported on 10.7 so I'm at a loss for how to continue debugging this issue.
I found an answer from another question. 10.7 doesn't support storyboards.
https://stackoverflow.com/a/30954258/873546

Xcode 5 Cocoa App Fails to Load Nib on OS X 10.6

I'm creating a Cocoa application for 10.6 and newer OSs. I created a brand new document-based application in Xcode 5 (10.9) and changed two settings to make it 10.6-compatible: I changed the deployment target to 10.6 and turned Auto Layout off on both MainMenu.xib and xxDocument.xib, the two default nibs that are included with the document-based template. I archived my application (no code signing) adding no other code and tested it on four different OSs. Here are the results:
OS X 10.9: Launches and shows a new document window ("Your document contents here") as expected.
OS X 10.8: Launches as expected; same as 10.9.
OS X 10.7: Fails to launch; Console applications yields "App Name: Unable to load nib file: MainMenu, exiting".
OSX 10.6: Fails to launch; Console yields same as 10.7.
I'm quite baffled as to the behavior of my application. I added absolutely no code to the template document-based app that Xcode created for me; I just changed the required settings to make it compatible with 10.6 and up. I also tried turning off ARC in the build settings, which made no difference at all. I checked Apple docs and also searched for other questions about the console error I received, but none of them were related to this problem. I was very surprised that 10.7 exhibited this behavior, as 10.7 is compatible with ARC. I would greatly appreciate any advice on how I can fix this problem. I would suspect that there is an easy modification to the default template, as Apple probably wouldn't supply a template that requires extensive modification to merely get it working. Thanks.
UPDATE:
As suggested, I turned off base internationalization in Xcode. I ran the app, and it worked fine. I exported the application (no code signing) and tested on all of the above OSs. This time, the error that I received above occurred for all OSs. This even occurred on the SAME machine that I built the project with, the only difference is that I didn't run it from Xcode. My next step was to actually make a MainMenu.xib file (because removing base internationalization deleted the old one) and set that as the main interface. Now not only do I get the error in the exported application on all OSs, but it shows up in Xcode when I try to run the application! Is there something else that I am missing?
AS mentioned before you need to disable Internationalization Base.
In the Project Navigator Click on the on the first item which is your project (denoted by blue page with white A in it, it is the root of all other items)
You should by default see the Info page to the left (if not select it from the tab at the top)
The last item in the Info property sheet is Localization. Under Localization you will have the ability to add and remove languages and you should by default have two already Base, and English.
Delete both, and deselect the check box "Use Base Internationalization"
Once you have done this, remove the any *.xib files you have from the project itself. MAKE SURE TO ONLY REMOVE REFERENCES !!!DO NOT SEND TO TRASH!!!
Once the references have been removed, go into Finder, Open your project directory and you will find a directory called Base.lproj with your *.xib files located in them. Copy or move them one level up to your project directory, and delete Base.lproj directory.
Go back into xCode and add back in your *.xib files. ++K to clean the project, then ++R to rebuild.
This should move the *.xib files in the App Package from Base.lproj (where 10.6 does not seem to find them) to the Resources file folder, and solve the problem.
Newly created Xcode 5 projects have base internationalization turned on. Base internationalization is supported on OS X 10.8 and later. You'll have to turn off base internationalization to support 10.7 and 10.6. See the following Stack Overflow question for more information:
Base.lproj/MainMenu.xib is not available when compiling for targets before Mac OS X 10.8
Another thing you may need to do to support 10.6 is to set the deployment target to 10.6 for both the project and the xib files. I know you said you set the deployment target to 10.6 in your question, but it wasn't clear if you set it for both the project and the xib files. As you're discovering, Apple's project templates do not place a high priority on compatibility with old OS versions.

What is the XIB deployment target? (OS X and iOS)

My app must run on OS X 10.6 through 10.9. The main window xib has a deployment target of 10.6 (same as the app itself). The main window nib also has the "Full Screen" attribute set to "Primary Window".
Since 10.6 doesn't support NSWindowCollectionBehaviorFullScreenPrimary, XCode 5 expectedly gives the warning Attribute Unavailable. Full Screen behavior on OS X prior to 10.7.
Questions
Can you ignore this warning and build safely for 10.6 without a crash on nib instantiation?
You can remove this warning by setting the xib deployment target to 10.7, but will the nib still run on 10.6? In other words, doesn't a xib deployment target of 10.7 cut off support for 10.6?
The "proper" solution seems to be to keep the deployment target at 10.6, unset the Full Screen attribute in the xib, and instead set it programmatically at runtime if running on 10.7+. Is this how you should always handle situations like this?
Generally, how does OS X fall back when attributes specified in nibs don't exist at runtime? I can't find a straight answer. Thank you.
The deployment target is the earliest OS version that can load the xib file. To answer Question 2, setting the deployment target to 10.7 cuts off support for 10.6. The nib file will not run on 10.6.
You listed the solution for supporting 10.6 and later in Question 3. I don't have an answer for Question 4.

Application is not working on 10.6

I'm currently working on a port of my Windows game for Mac OS X, it runs fine on my Mac when compiled with Xcode 4.5.2 on OS X 10.8, but it crashes on a friends Mac running 10.6. At first I thought it was due to one of the Frameworks I've been using, but the standard Cocoa app template crashes at well, without any visible error message.
I already tried setting the Deployment Target to 10.5, but this doesn't change anything. When starting the App, it appears for a short time in the Dock and then disappears without showing any kind of UI or error message.

Resources