I'm trying to compile the PSTCollectionView library using XCode 4.6, but for some reason, I'm getting a ton of compiler errors. They're all centered around the newer features of Objective-C.
A few examples:
However, the new array/dictionary/NSNumber macros are defined:
I'm using the Apple LLVM Compiler
I'm a bit stumped by this... any notions?
This is apparently an issue caused by using the wrong SDK. I was using the iOS 5.1 SDK, which does not allow the use of these handy new shortcuts that Apple added. When I change to the iOS 6.1 SDK, it no longer complains about that usage.
Apple lets you know in this article here.
Related
I have Xcode 6 and the game I am writing crashes when I run it in the iOS7 simulator.
Yes, I can read the logs during runtime such as [SKEmitterNode nodeWithFileNamed:] doesn't exist in iOS 7. But it would be much nicer to see that this method doesn't exist when I'm typing it (also without having to look at the developers documentation) since I learned Sprite Kit on iOS 8.
I know you can do this if you change the SDK to iOS 7, but I've read numerous problems happens if you rig the project like that. Is there any other way to get errors or warning before runtime?
The application DeployMate is made for exactly this purpose.
I just upgraded from Xcode 6 Beta 2 to Xcode Beta 3 and am now getting the following warning when building my project:
ld: warning: relocatable dylibs (e.g. embedded frameworks) are only supported on iOS 8.0 and later (#rpath/libswift_stdlib_core.dylib)
It is a warning but seems to mean my current setup will not work on iOS 7.1, which is my deployment target. How can I track down which frameworks are embedded, and how can I fix this for iOS < 8.0?
This appears to be a bug of Beta 3. As pointed out by Apple Engineer on this post.
I have also been living with this warning when running apps on iOS 7.1 device.
You see and add them on the project page when you select the target: tab General->Embedded Binaries (and they then appear in Build Phases->Embed Frameworks).
Embedded frameworks for OSX were available in Xcode 5, but not for iOS.
WWDC session regarding new features in Xcode 6 specifically promised dynamic frameworks for iOS 8 (someone please add citation when developer center comes back online). So far, with all Xcode 6 betas, I have had no problems compiling and debugging an app with frameworks on iOS 7.
But since this wasn't promised, frameworks for iOS7 is something you cannot depend on (e.g. this may stop working in later betas; an app with embedded framework for iOS 7 may be rejected, etc.). That may explain why they added an explicit warning.
There's not much you can do if this feature turns out to be indeed unsupported, other than remove the frameworks from the target and use static libraries as we did with Xcode 5. Or go the iOS8-only route.
After using XCode 6.1.1 I am able to put the code on iOS 8+ iOS7.1.2 and iOS 6.1.3 Although the warning is still there but the app works absolutely fine on all the 3 OSs
======================
Lucky guy... My project keeps failing to compile after I referenced the PushKit framework.
The project is a new project created by Xcode with only 3 new functions for testing Push Notification.
The workaround is to put the PushKit framework as "embedded", but this is not a good solution since my working Xcode project will be generated from Unity3d. Making the changes manually will break the auto build process.
I had this error after adding a C++ framework (DeepBelief) to a project. Adding an empty .cpp file to the project fixed it.
I'm using Beta4, and found the answer on the DeepBelief github site:
XCode may be skipping the standard C++ library, and that's needed by
the DeepBelief.framework code. One workaround I've found is to include
an empty .mm or .cpp file in the project to trick XCode into treating
it as a C++
project.
Read this github post from ReactiveCocoa
The bug is still present in XCode6 GM and so XCode6 final release:
Well, I get the exact same issue in xcode6GM no matter whether I
create framework for swift OR objc :-[[[[[[[[[[[[[[[
According to Apple Extension Programming Guide:
You can make a containing app available to users running iOS 7 or earlier, but then must take precautions to safely link embedded frameworks when running in iOS 8 or later.
talking about app extensions, but if you read it, you can understand that this applies to embedded frameworks in general.
this is happening because one of your embedded binaries's deployment target is lower than your applications target. lower your embeded binaries's building target and be fine.
this was the error cause in xcode 6.1.1
i was using xcglogger with deployment target ios 8.0, and my application's deployment target 7.0. set the xcglogger's deployment target ios 7.0 and problem solved.
After using XCode 6.1.1 I am able to put the code on iOS 8+ iOS7.1.2 and iOS 6.1.3
Although the warning is still there but the app works absolutely fine on all the 3 OSs
Yes not able to submit the app for review.
Had to do by changing the modern frameworks to Static libs.
As Swift supports the mix-match with objective c , then can we use it for building the applications having deployment target less than iOS 7.
from Swift Prerelease Documentation Under the Basic Setup Section what i read is :
Swift is designed to provide seamless compatibility with Cocoa and Objective-C. You can use Objective-C APIs
(ranging from system frameworksto your own custom code) in Swift, and you can use Swift APIsin Objective-C.
This compatibility makes Swift an easy, convenient, and powerful tool to integrate into your Cocoa app
development workflow.
This guide covers three important aspects of this compatibility that you can use to your advantage when
developing Cocoa apps:
● Interoperability lets you interface between Swift and Objective-C code, allowing you to use Swift classes
in Objective-C and to take advantage of familiar Cocoa classes, patterns, and practices when writing Swift
code.
● Mix and match allows you to create mixed-language apps containing both Swift and Objective-C files that
can communicate with each other.
● Migration from existing Objective-C code to Swift is made easy with interoperability and mix and match,
making it possible to replace parts of your Objective-C apps with the latest Swift features.
So after reading this the questions arrises in my mind are
Can we use swift for the applications we are currently working
on.
If the answer is no then it will be contradict to the above
explanation.
Update - As per Xcode 6 Beta 4
iOS 7 and OS X 10.9 minimum deployment target
The Swift compiler and Xcode now enforce a minimum deployment target of iOS 7 or OS X
Mavericks. Setting an earlier deployment target results in a build failure.
From Xcode 6 release note
So my previous answer(Shown below) will not be applicable to any further swift development. Swift will no longer available for iOS6 and below
Yes you can . I have tested a simple app written completely in Swift in my iOS6 device, it works perfectly fine. As apple says Swift code is binary compatible to ObjectiveC code. It uses the same compiler and runtime to create the binary.
So if you are not using any new APIs added as part of the iOS8 SDK or some swift specific api's (corresponding api is not available for ObjectiveC) your app will seamlessly work on iOS6+(Tested and working) even iOS5(not tested). Most of the APIs in the swift are just the replacement of the existing ObjectiveC api's. In fact they are same in binary.
I am not sure but YES swift support lower version of ios in to Xcode Beta if you are check in to Project-->Target-->General-->Deplyment Info for select deployment target there is drop-down with 6.0,6.1,7.0,7.1 and 8.0
So i think yes swift support lower version.
I just test the demo that created in Xcode6 with swift language select. then i open this project in to Xcode5 with deployment target 6 and that runs it means that working with lower version too.
Here it is a screenshot of swift project runs in xcode5 with ios6.1 simulator:
HERE IT IS DEMO AS WELL http://www.filedropper.com/demo_5
Yes you can . I have tested a simple app written completely in Swift in my iOS6 device, it works perfectly fine. As apple says Swift code is binary compatible to ObjectiveC code. It uses the same compiler and runtime to create the binary.
So if you are not using any new APIs added as part of the iOS8 SDK or some swift specific api's (corresponding api is not available for ObjectiveC) your app will seamlessly work on iOS6+(Tested and working) even iOS5(not tested). Most of the APIs in the swift are just the replacement of the existing ObjectiveC api's. In fact they are same in binary.
No, only iOS 7+ and OS X 10.9+.
You can import and run swift code from Objective-C like this:
#import “ProductModuleName-Swift.h”
MySwiftClass *swiftObject = [[MySwiftClass alloc] init];
[swiftObject swiftMethod];
You can check the iOS version number with this gist and only run the swift code if the version is >= 7.0.
Yes, the minimum deployment target for Xcode 6 with Swift language is iOS 6.0
Yes you can. Its not important in which language you are writing the code. Finally what matters is compiler and architecture. So, you should definitely able to deploy them to OS version less than 7.0
After I updated Facebook iOS SDK from 3.2 to 3.5 I'm getting this error when running my app in a device with iOS older than 5 (eg 4.3.5).
dyld: Symbol not found: _OBJC_CLASS_$_NSJSONSerialization
...
Expected in: /System/Library/Frameworks/Foundation.framework/Foundation
I can avoid this crash if I set Foundation framework as Optional, but I don't think this is the best option.
Is there another way to make Facebook SDK works in devices with iOS previous to version 5?
From Facebook iOS SDK changelog v3.5:
http://developers.facebook.com/ios/change-log-3.x/
Removes support for iOS 4.* Facebook 6.0 dropped support for iOS 4.x. To stay in sync, the Facebook SDK is also does not support iOS 4.x.
So, if you update to Facebook SDK 3.5 you lose support for iOS 4.x
That class was not available until ios5 - look at the class reference in the Xcode documentation window. What you need to do is grab JSONKit, an open source class, and use it. Usage is mostly the same. You will need to build this class into your app then test dynamically if the apple class exists, then use the appropriate class, or just always use the open source class.
Note that JSONKit is not ARCified, so you need to set the appropriate compile flag for it if the rest of your app is ARC.
Edit: so you may be able to get clever and write your own stub that bridges calls to JSONKit in older releases. Conceptually you should be able to make this work, but my fear would be that if the FB code was developed for ios5 then there may be other Api problems lurking in the code too - and you old spend a lot of time continually trying to find and fix them.
I'm new to using Quickdialog. I imported QuickDialog in my project following the steps on the official site (my project does not use ARC). I'm using xCode 4.2 but getting "_dyld_dyld_fatal_error" when running on iPhone 4.3 simulator. Please see attached screenshot here for more info in the crash.
I'm the developer, and QuickDialog requires iOS5 and an ARC compiler. You would need to change a lot of code if you were to use it without that, and I have no plans of supporting that.