Xcode app version not compatible with Mac OS X version - objective-c

am using Os X 10.6.4 and X code Version 3.2.3 for developing some simple app files and using PackageMaker to distribute these app files. But when trying to run the package on some other mac I am getting error that the package is not compatible with the Os X its running and file would not be installed. Is this a problem with X code or package maker. sorry for reposting it but although I tried changing base SDK to 10.5, it was getting compiled and ran well on mac I am using for development (Mac OS X 10.6.4) but when installed on mac running OS X 10.5 the .app files were grayed out and message poped up saying 'you cannot use this version of application with this version of Mac'. Any idea why is this happening? Also as mentioned earlier I am using IBOutlet for accepting user date from form and then writing that into a text file. Any idea or solution about it?

Do you have anything set in your Info.plist for the LSMinimumSystemVersion key? This is one place the system looks.

When I was brand new I had trouble figuring this out...
Make sure that your Base SDK and deployment target are 10.5 and that you have the right compiler on(GCG4.0/4.2), also make sure that when you change these settings you change it for both Release and Debug, I once made this mistake of changing it only on debug, and when I built for release it only worked on 10.6 because I didn't change those settings.

Related

Will Mac application developed in latest XCode work in old OS-X?

I have MacOS-X - 10.7 and Xcode - 4.6.2 and made a Mac application. The client side machine is also MacOS-X - 10.7. But in my mac application there was a small error with NSNumberFormatter which when I was changing, Xcode was crashing. So I edited the code in latest Xcode and OSX. And then I made the binary of it and run in MacOS-x - 10.7, its working fine. But the source code is no more opening in Xcode - 4.6.2. Its asking for the latest version of Xcode. My question is will the binary will work fine in older version of OS-X even if it is developed in latest Xcode?
The version of OS X which your application will run on is dictated by the OS X Deployment Target in the project settings. If that is set to support 10.7, then it doesn't matter which version of OS X you built it on: the built application will work on 10.7 and later.
This setting will also set the minimum allowed OS in the Info.plist, so people trying to run the build on earlier OSes will see an alert instead of the app just crashing.
More information on setting the deployment target and building for different OS versions with SDKs is available in the Apple documentation:
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html

Backward compatibility for OSX Apps

OK, so here's my situation :
I've got Xcode 5.1.1 on a 10.9 (Mavericks) machine
I want to build my app so that it runs on 10.6 and later
SDKs installed : 10.6, 10.8, 10.9
What do I have to do to make sure it'll show up as "10.6 and later" compatible in the app store?
I managed to get it to compile fine with Base SDK set to either 10.8 or 10.9, and Deployment Target set to 10.6. Will that suffice?
P.S. I've tried compiling with Base SDK set to 10.6, as well, but there are so many errors to be fixed, that it'd be better if I could avoid it.
So any ideas?
Yes; using 10.9 SDK with the deployment target of 10.6 will work fine.
You may find you have conditional code-paths which must be determined at runtime, perhaps based on respondsToSelector, which will require some #pragmas in order to compile successfully.
The Deployment Target defines the minimum OS version that your app requires at run time.
The Base SDK defines the level of API features that are available at compile time.
Therefore you can use 10.9 as Base SDK when building apps that can run on 10.6 and upwards.
You just have to make sure to avoid code paths that use 10.7/10.8/10.9 APIs when your app runs on a 10.6 machine.
As trojanfoe already pointed out, you can use respondsToSelector: to check if a certain class/method is available.
Another way is to use NSAppKitVersionNumber:
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_8)
The NSAppKitVersionNumber constants for the latest SDK can be found in the AppKit Release Notes.
Further details can be found in Apple's SDK Compatibility Guide.

Debugging objc4 (532.2) on OS X 10.9

I'm trying to get objc4-532.2 to work on Mavericks.
(First of all, I tried to compile the latest version of objc4 (objc4-551.1).
This fails due os/lock_private.h is missing (objc-os.h). Maybe anyone knows how to solve this issue?)
Back to topic:
To successfully build objc4-532.2 I need to link against the frameworks which are based
on OS X 10.8.
So I configured the Xcode project to use OS X 10.8 SDKs for Base SDK and OS X Deployment Target.
This works, and I can compile and link a simple console based C program (Xcode template).
However when I try to link this program against Foundation and debug it, it miserably fails with the following error:
dyld: Symbol not found: _objc_debug_taggedpointer_mask Referenced from:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
Expected in:
/Users/manu/Library/Developer/Xcode/DerivedData/objc-dtrsexfveobodwdnwlpknyyiekpe/Build/Products/Debug/libobjc.A.dylib
in
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
The symbol _objc_debug_taggedpointer_mask was first introduced in objc4-551.1 (latest runtime) and all 10.9 Frameworks needs to access this symbol (at least in debug mode).
Example:
$ cd /System/Library/Frameworks/Foundation.framework/Versions/C
$ grep objc_debug_taggedpointer_mask Foundation
Binary file Foundation matches
A Framework based on 10.8 doesn't contain such a symbol.
Since my project is configured to use 10.8 SDKs this error should not occur?!
So, what's the missing point?
Thanks!
I solved this problem: the symbol of objc_debug_taggedpointer_mask was imported into runtime after mac os x 10.9, so you need to add the new tags into the 532.2's code to make it compatible with os x 10.9's foundation and other frameworks.
Here is my working directory:
https://github.com/Jeswang/objc4-532.2
(First of all, I tried to compile the latest version of objc4
(objc4-551.1). This fails due os/lock_private.h is missing
(objc-os.h). Maybe anyone knows how to solve this issue?)
The best solution I could find is to manually scrape together the header files as described here:
http://www.mulle-kybernetik.com/weblog/2011/how_to_build_libobjc_for_os_x.html
The closest thing to os/lock_private.h that I have found is private/tsd_private.h from the libpthread project:
https://opensource.apple.com/source/libpthread/libpthread-105.40.1/private/tsd_private.h
Edit
I have also found this:
https://github.com/samdmarshall/OSXPrivateSDK

Compiling libogg using Xcode 4

I've just downloaded libogg from http://www.xiph.org/downloads/ (http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz) and I'm now trying to compile the Ogg.xcodeproj project provided in that package. When I try to build, I get the following error:
The run destination My Mac 64-bit is not valid for Running the scheme 'Ogg'.
The scheme 'Ogg' contains no buildables that can be built for the SDKs supported by the run destination My Mac 64-bit. Make sure your targets all specify SDKs that are supported by this version of Xcode.
I get a similar error if I attempt to build the static library instead of the framework:
The run destination My Mac 64-bit is not valid for Running the scheme 'libogg (static)'.
The scheme 'libogg (static)' contains no buildables that can be built for the SDKs supported by the run destination My Mac 64-bit. Make sure your targets all specify SDKs that are supported by this version of Xcode.
Again, this is just opening the project in Xcode 4.3.2 for the first time and attempting to build. I've made no changes to the project file at all.
Can anyone point me in the direction of a solution to get this to compile?
In my case, the Xcode project was linking against an old SDK on an old architecture (OS X 10.5 PPC, whereas I have OS X 10.8 Mountain Lion x64).
To fix this in Xcode 5, select the top-level project in Xcode (the top-most node in the project folder pane, with the blue "A" icon) followed by the Project. Change Architectures to something suitable for your current system, such as Native Architecture of Build machine and change Base SDK to an SDK currently installed in your Xcode environment, such as OS X 10.8.
Here is a screenshot of my project to help you find those settings (following the highlighted parts: kisshelper > kisshelper > Architectures):

Compatibility issues with package developed on OS X10.6.4 on older OS X

I am using Os X 10.6.4 and X code Version 3.2.3 for developing some simple app files and using PackageMaker to distribute these app files. But when trying to run the package on some other mac I am getting error that the package is not compatible with the Os X its running and file would not be installed.
Is this a problem with X code or package maker. Any idea or solution about it?
thank you for your help in advance.
Go to Project Settings and change your base SDK from 10.6 to 10.4 or 10.5.