Obtaining 10.6 Base SDK for Xcode 4.5.2 - objective-c

How can I obtain and use 10.6 as base SDK in Xcode 4.5.2?
I downloaded Xcode 4.5.2 from the Mac App Store (through a link on the Apple developer site).
Is there a way I can somehow download the 10.6 SDK separately and start using it as a base SDK?
Strangely enough, I can download the documentation for the 10.6 SDK through Xcode's Preferences window, but not the SDK itself. Any ideas?

No, you can't download the 10.6 SDK separately.
Is there a reason you can't use the 10.8 or 10.7 SDK?
Keep in mind that just because you build against the 10.8 SDK, that doesn't mean you can't also have that built application work on 10.8, 10.7 and 10.6. (This is often a cause of confusion among new developers). You control backwards-compatibility through the Deployment Target setting like shown in the image below.
By default, the deployment target is generally set to the same version of OS X as the SDK is, but changing it to 10.6, for example, should allow it to run on a machine with OS X 10.6. (Of course, you should really test to make sure that's the case).

Download xcode with MacOSX10.6.sdk. Now copy MacOSX10.6.sdk inside /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
Its also working fine with Xcode 5.0.

Related

Update ios simulator to 7.0.6?

Is it possible to update iOS simulator to the latest version of iOS? Now it is 7.0.6, but my simulator is 7.0.3, I have XCode 5.0.2 and updated all downloads in Preferences.
Apple has not released any further 7.0.X SDK than 7.0.3. The reason for that is because the API has not changed, and neither has behavior changed significantly enough to warrant a new SDK release. 7.0.6 in particular is only a security update and would not be applicable to the simulator at all; the simulator uses the underlying OS X infrastructure for network connections. You should wait for the upcoming OS X security fix.
You can, however, download beta releases of Xcode 5.1 with 7.1 beta SDK, and make sure your app is ready for the upcoming iOS 7.1 release.
the simulator is definitely still vulnerable to gotofail even on macs that have been updated with the security fix. this is easily testable by using it to browse to gotofail.com on osx 10.9.2: https://twitter.com/visnup/status/444992820915363840

How to easily test cocoa app on different version of mac osx?

I have a macbook air 2011 version and have 10.8.x installed on it. I used xcode 4.6 to develop an app, I tested it using this machine and worked perfectly fine.
I want my app to support 10.6 (snow leopard) and 10.7 (lion) as well (I set my deployment target to 10.6 and base sdk to 10.7) , so in order to test it, I compiled my app using my macbook (again, 10.8 mountain lion) and copy the app to my other 10.6 machine (hackintosh).
Testing on 10.6 is a pain in the butt, I have learnt a few tricks tried to make the testing easier (ie. implementing redirectConsoleLogToDocumentFolder so that all NSLog will be added to the console.log), however sometimes my app will cause a segmentation fault, which can't be caught by try catch, and I really had no clue what caused the problem.
My questions are:
1. how to easily test my app (with ARC enabled) on a 10.6 machine without xcode? I have installed xcode 4.2 on snow leopard, however it doesn't support arc and couldn't compile, even I downloaded the 10.7 sdk and put it into my xcode folder.
2. are there any other tricks you can share with me, to make the testing on 10.7/10.6 easier?

iPhone 5.1 App using OpenCV crashes due to "nonatomic" not found

I'm developing an iOS App which targets iOS 5.1+. I'm using XCode 4.5 on Mac OS X 10.8 and I do own an iPhone 4 with iOS 5.1.1. The app needs OpenCV, which I have successfully built from sources according to a tutorial in the OpenCV-Documentation.
Here is what happens:
When I start up the application I get an exception:
dyld: Symbol not found: _objc_setProperty_nonatomic
The error does not occur with iOS 6, but with iOS 5.1 in both the simulator and on a real device.
What is that? Is it related to OpenCV? Does it have to do something with incompatibilities between iOS / the iPhone / XCode??
EDIT: My development target is set to 5.1. The Base SDK is 6.0. I copied an SDK für 4.3 (which is the lowest version that XCode 4.5 will support) from another Mac and set development target as well as the base SDK to 4.3. Did not work either (it did not even build then).
I did not an update, the project has been started from scratch using XCode 4.5 initially.
Meanwhile I also found a tip to use gnulibc++ instead of libc++, but that also resulted in that the project did not build at all.
I built a test project and found the same issue. OpenCV is being built with a deployment target of ios6, this is a known issue, and a fix is pending review, see https://github.com/Itseez/opencv/pull/70

Can I build for 4.x simulator but run in 3.x simulator?

Ok, there have been some questions alluding to this before, and I've even read some second-hand reports of people successfully doing this, but so far I haven't found a concrete answer.
Basically, I want to build an application for simulator using iOS 4.x, and then run it on a 3.x simulator.
I have both SDKs installed, so all I need is the last mile of getting the app to show up in the 3.x simulator.
I tried just copying the app across from Library/Application Support/iPhone Simulator/4.2/Applications to Library/Application Support/iPhone Simulator/3.0/Applications but it doesn't show up when I load the 3.x simulator. There's a binary plist called applicationstate.plist, which I'm guessing keeps track of what apps are installed on the simulator, but I don't know what the binary format is so I'm kind of stuck at this point.
Has anyone managed to load a 4.x app onto a 3.x simulator? And if so, how did you do it?
Why are you even trying to do this? What are you trying to achieve? If what you really just want to do is ensure the app works on iOS 3.x then simply state that in xcode and don't worry about the actual simulator. The simulator could be running iOS 5.0 for all you should care as long as you have set 'iOS Deployment Target' to '3.0' in xcode's project settings. That will ensure the application is compatible with iOS 3.x and above. Obviously you then still need to ensure you're not calling methods from SDK 4.x when it will run on an iOS 3.x device. If that is what you're trying to test then what you're doing won't actually work. You should (as Apple advises) always grab hold of a real device running the target firmware version and test it on that. Grab an old iPod for example with iOS 3.x and try testing your app on that to ensure you haven't called iOS 4.x methods when running under an older firmware.
The answer is: No, you cannot build for 4.x simulator and run on a 3.1.x simulator or earlier due to fundamental changes in the way the simulator works.
The only way to test 3.x support is to either run it on a 3.x device (after setting min deployment target), or build on an older xcode that supports 3.x simulator (which isn't feasible if you use Xcode 4, except for iPad 3.2).
Note: Setting the deployment target does not test compatibility with older operating systems. It's the operating system that it actually RUNS on that matters (such as "iPhone 4.3 Simulator", "iPhone 4.0 Simulator", "iPad 3.2 Simulator", or an actual device).
Of course, now that 3.x users make up less than 10% of the total population, it's not really worth the trouble to support it anymore.

Building a backwards compatible OS X app, when a new API is present?

I'm trying to upgrade an app (Clarke) to provide 10.6 compatibility.
My plan is to use two different code paths depending on the version of OSX in use.
On 10.5 it will use one controller, which consists of completely custom code that isn't dependent on any specific Cocoa API. On 10.6 it will use another controller, which wraps the new CoreLocation API in an identical interface, based on the same abstract class. At runtime the app will switch between the controllers by detecting the OS version.
This works fine on 10.6 built for the 10.6 SDK, but the same build blows up on 10.5 with:
10/09/2009 18:30:50 [0x0-0x12f12f].uk.co.tomtaylor.Clarke[4575] dyld: unknown required load command 0x80000022
10/09/2009 18:30:51 com.apple.launchd[403] ([0x0-0x12f12f].uk.co.tomtaylor.Clarke[4575]) Exited abnormally: Trace/BPT trap
If I build for 10.5 SDK it can't compile the CoreLocation stuff, obviously.
I'd hoped to be able to provide a single binary for this application. Is there a way to 'hide' the CoreLocation API from 10.5?
The Deployment SDK trick works only when you have the same framework on both platforms but new calls in the newer one. For CoreLocation, the entire framework is missing on 10.5, so your app will fail to load because it cannot dynamically bind to the framework.
You need to do the above, plus add CoreLocation as a weak framework. Select your Link Frameworks and Binaries build phase, find CoreLocation in the Detail view, and in the middle column change "Required" to "Weak".
When you build your app, Xcode will pass -weak_framework CoreLocation to the linker, and your app will load on all 10.5 and 10.6 systems regardless of whether CoreLocation is present. It's up to you to make sure not to call any CoreLocation methods unless you are actually running on 10.6, though.
You should be able to solve this problem by changing the build settings of your target:
Set the Base SDK to 10.6
Set the Deployment SDK to 10.5