Xcode 6 beta 5 won't build Swift with iOS 7.1 SDK - xcode6

Despite the release notes stating this is supported and previous version of Xcode 6 working ok, I have a rather verbose error message when trying to build with 7.1 SDK.
"iOS targets using Swift cannot be built against an SDK older than 8.0, but the effective SDK is 7.1."
Has anyone else seen this?

I just had this issue, but with the app store build of Xcode 6.0.1 (6A317).
The issue was that I had copied old SDK's (7.0, 7.1) into the Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs directory. This was causing Xcode to use the wrong SDK for building.
Deleting them solved this problem for me. That'll teach me for mucking around with Xcode.

Related

import CallKit crashes randomly on iOS 9

I have imported CallKit framework as optional only. But import CallKit crashes while running on iOS 9 at launch. But works perfectly on iOS 10.
It worked fine in XCode 8 beta 6 but this issue is happening only on XCode 8.
The code is in Swift 3.
Any help is much appreciated.
CallKit API is only for iOS 10.0+. It won't work for iOS 9.0. Use a condition for iOS version 9.0 and 10.0 to avoid the crash.
Reference : https://developer.apple.com/reference/callkit?language=objc
There is/was a bug in Swift 3 language that wrongly links module libraries github pull request, that is fixed now, but the fix is not yet implemented in XCode, not even in beta.
You could get latest swift toolchain build from link and install it to XCode to try and see the fix, but the app would not be approved for Appstore as it's stated here
You got two solutions;
wait for apple to release XCode with new version of swift 3.0.2+
or revert your code back to swift 2, where it works, with "Use Legacy Swift Language Version" flag in Build Settings
If you choose to revert back to swift 2, brace yourself with a lot of patience :D

Compatibility of Xcode 5 with Xcode 6

Apple has now announced Xcode 6 (and iOS 8). I currently have Mavericks on my Mac (and am not planning to upgrade to Yosemite yet), and am wondering if I can download the Xcode 6 dev preview, while still maintaining my current version of Xcode 5. This is so that I can use the new Xcode 6 features, while still being able to work on, and upload, my current applications. Is that possible?
Also, if I update my phone to iOS 8 Beta, will I be able to run apps from Xcode 5, or only Xcode 6?
Answers would be hugely appreciated! Thanks :)
Even I use Mavericks, I installed Xcode 6. In order to be sure about my maintenance projects, I've also downloaded Xcode5.1.1 from Apple developer portal, copied it into my Desktop, renamed it as XCode 5.1.1 and then moved it to my applications folder.
I have both versions at the moment without any issues and can also select the version of Xcode while opening an existing Xcode project by using open with menu feature.
I hope this helps...
Xcode 6 Beta Release Notes
Xcode 6 Beta requires a Mac running OS X version 10.9.3 (or later) or 10.10.
I think its possible that you can do all things you was able to do with Xcode 5 but I will tell you when my xcode 6 download is finished.
You may install XCode 6 Beta on OS X 10.9.3, and I think that you'll need XCode 6 in order to run iOS8 apps.
One thing that you didn't ask, but that you should keep in mind (as you mentioned your phone):
Devices updated to iOS 8 beta can not be restored to earlier versions
of iOS.
i've installed Xcode6 in Mavericks and iOS simulator crash with message : Unable to boot the iOS Simulator. :-(
You can download the preview of Xcode 6 and use your existing installed Xcode 5 side by side without affecting anything you're doing. Just make sure if you click on a project file that you open it in the correct version of Xcode.
Download xcode dmg file from Apple's developer site. Install it in a different location other than the Applications folder. There you go !!

How to install Xcode 5?

OK, as it turns out, I did not explain my question very well at all. here is a complete re-write.
I have Xcode 4/iOS SDK 6.1 installed. I want to install and use Xcode 5 but want to use iOS6.1 SDK. I know that I can download iOS6.1 SDK from Xcode 5. But, I want to avoid that since the iOS 6.1 is already in my hard drive. Is there any way I can avoid having to download iOS6.1 SDK again.
You download Xcode 5 from the Appstore.
In preferences / Download you can download the iOS 6.0 and 6.1 Simulator
In Project Info you set the iOS Development Target to 6.1 and in the Storyboard you can chose as which iOS (6.1 or 7.0) the Views should be displayed.
EDIT: Also, Xcode5 supports earlier iOS with the same files you already have. There is no need to separate iOS 7 from the earlier Versions.
No need. Xcode 5 supports iOS 6 integration. For more info about this, look at this post: Can one develop for iOS 6 using XCode 5 on Mavericks (OS X 10.9)?
EDIT
Here is how iOS 6 SDK can be installed in Xcode 5 (requires Xcode 4 to get the SDK)
In finder, go to Applications, and find Xcode (4)
Right Click into Show package Contents
Navigate to Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Copy iPhoneOS6.1.sdk
Once you download/update-to Xcode 5, go into the same folder, where you should see iPhoneOS7.0.sdk
Paste the SDK in this folder
Fore more information on setting up Xcode 5 for iOS 6, look here: Is it possible to install iOS 6 SDK on Xcode 5?
Although this question isn't really meant for SO (More for Superuser),
Can I have multiple Xcode versions installed?
how to install two versions of xcode
This should answer your question. (The installer gives you the option of where to install it; you can simply choose a different directory)

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

compile problem for xcode 3.2

Hey I have problem compiling code in xcode 3.2
I have a code where it's using iOS 4's API, "MFMessageComposeViewController"
It would compile fine with 4.0 under xcode, but when when i try to compile with 3.2 I get error because of "MFMessageComposeViewController".
It seems that xcode can't find keyword for MFMessageComposeViewController.
In order to be able to compile for 4.0 and 3.2 and still use MFMessageComposeViewController, what should i do?
thank you!
I can't determine whether the version numbers you are referring to are to do with the iPhone OS version of the Xcode version.
The documentation for MFMessageComposeViewController shows that it is only available in iOS 4.0 and later, so you can't use it at all in earlier versions of iPhone OS.
If you are having trouble with Xcode version 4, you cannot ask for help here because it is under a non-disclosure agreement, as far as I am aware. If you are using Xcode 3.2 to compile for source code targeting iOS 4.0, ensure that your project settings are correct and are set to use the iOS 4.0 SDK.