I'm building a library and some of the functionality is broken when the app using it is running newer base SDK (xCode 6, Base SDK iOS 8.0).
When trying to fix the issue, the Applications built with older SDKs are broken. (xCode 5, Base SDK 7.1)
It's not related to the version on the device.
Is there a way to check in code what's the Base SDK set by the App?
You can use macros. As described by rckoenes in this question you can use macro __IPHONE_7_0 to know that you are compiling with iOS 7.0 SDK. For iOS 8.0 SDK you can use __IPHONE_8_0 macro of course. These macros are defined in Availability.h header.
Also be sure to read Apple's SDK Compatibility Guide to understand more about working with multiple SDK's.
Related
My project must support iOS6.
I use Google Sign-In SDK v2.4.0.
But When I selected Target , the GoogleSignIn.framework (optional) in Xcode project and run on the iOS6 device, dyld log tells
dyld: Symbol not found: _OBJC_CLASS_$_NSURLSessionConfiguration.
Is there how to use this in iOS6 Device??
The GoogleSignIn guides don't state a minimum SDK version however...
NSURLSessionConfiguration was introduced in iOS7 so if you are getting that issue when trying to link to the SDK then iOS 6 certainly isn't supported.
Checking out the sample project (pod try Google) and it also has the Deployment target set to iOS 7.0 so it looks like you are out of luck I am afraid. Maybe look at using an older version but I can't help you with what version supports iOS 6 and I would not know if it is still supported/maintained by Google.
How can I get the version of the base SDK in code? I am currently building for iOS in XCode 6 and using the base SDK 8.1 . I would like to know if there is any define with the value of the SDK to be able to test it and allow building with different base SDKs.
You can find out the version of the current Foundation framework that the code is running against by checking the value of NSFoundationVersionNumber.
If you check out the NSObjCRuntime.h you will find the various version numbers listed in there.
As in regards to building against different versions of the SDK; Apple stops App Store uploads if you don't build against the latest SDK once the cut off date has come into effect - i.e. new apps submitted now must be build against iOS 8 SDK.
What you can however do, is have a lower iOS Deployment Target (this you can find in your project's settings). This will allow for your app to run on older iOS versions, but it will still be built against the latest SDK. Do note though, it is your responsibility to ensure that you do not use any new APIs without first ensuring the current environment supports them e.g. UITextField's selectable property.
If you call that whilst running on iOS 6, your app will crash.
This can be done using __IPHONE_OS_VERSION_MAX_ALLOWED (which is the same version as the base SDK version). That can be compared to __IPHONE_8_0 where 8_0 is the iOS release.
For example, at this point you can use the baseSDK 8.0 or 8.1.
I have a iOS 7.0 app, I need it run perfectly on iOS 6.1. I have download the iOS 6.1 simulator, and I have the iOS 7.0 sdk as the base sdk. If I want my app to run perfectly both on iOS 7.0 and iOS 6.1 do I have to set the base sdk as 6.1? or keep iOS 7.0 as the base sdk and just run this app using iOS 6.1 simulator. I know I should the set the deployment target as iOS 6.1 so It can work on iOS 6.1. I just don't know how to set the base sdk. Can anybody explain me the base sdk and deployment target?
The base SDK defines which functionality you can use in your apps. As of today 2014-03-31, you can't submit applications that have a Base SDK set to iOS 6 anymore. You need to compile your apps with the 7.0 base SDK.
The deployment target describes the lowest iOS version your app will run on, so in your case it's 6.0.
If you're using iOS 7-only features, you'll have to implement runtime checks, largely based on -respondsToSelector:. That'll allow you to gracefully degrade on old versions.
Set the base SDK to be always the latest, be it 7.0 or 7.1. Your app is compiled using that sdk and therefore newer SDK compatibility and functions are applied to your project.
setting Min Deployment target allows compiler to check for API methods compatibility with that OS version in mind.
Hope it clears up your doubts.
I have a Application Where i am integrating GooglePlus SDK to support GooglePlus.Its working fine till IOS 5.But when we run on IOS 4.3 it crashes with following Error.
dyld: Symbol not found: _OBJC_CLASS_$_UIStoryBoard
i am not using Any storyBoard in my Application but why this error Comes??
As per googlePlus Documentation it supports From IOS 5. But i just want to Know there is any way where we can make it work for IOS 4.3 as my Application Supports from IOS 4.3.
Is it Possible To support for IOS 4.3? If Yes how can we solve this.
As you can see from the exception, class UIStoryBoard is not supported in earlier versions of iOS than 5.0.
Since Google Plus SDK uses Storyboard in some way, unknown to me personally, you cannot use this SDK with any iOS that has version less than 5.0.
Reference from Apple:
UIStoryboard: Available in iOS 5.0 and later.
P.S. It seems to me that it is too redundant for any kind of a project to support version that is 3 releases older than current - iOS 7.
I.e., is it possible to know if my code is compiled under SDK 5.1, or 6.0, or any other version?
#ifdef __IPHONE_6_0
// Will be ignored when compiled under SDK 5.1
#endif
When you are compiling under iOS SDK 5.1 or any other older SDK there is no #define for __IPHONE_6_0, so checking if the macro is defined helps to check the SDK version.
Take a look at the file "Availability.h" and "AvailabilityInternal.h" in the iOS SDK and you'll see conditionals that you may be able to make use of. The Apple OpenSource ones that I linked to (which I found in this closely related question) aren't the same ones that you'll find in your SDK.
For example, I see a define for "__IPHONE_OS_VERSION_MIN_REQUIRED" and if you want to compile this code only on iOS 6 & newer, you'd make certain to have this set to "__IPHONE_6_0".