Reputation: 6969
I have couple of apps that run on iOS 5 through 7. It's already pain maintaining different set of apis.
On my new OS X Mavericks box with Xcode 5, it simply refuses to show me iOS 5 simulator.
To add to that pain, when I attach my iOS 5 device, my app simply crash complaining about iOS 6 features (not present in iOS 5 - UICollectionView for example).
Here is the crash log on my iOS 5 device:
Symbol not found: _UICollectionElementKindSectionHeader
Note that for the last problem - I have all conditional compiling MACROS in my code. Such as, I wrap my UICollectionView code between:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_6_0
#endif
I also do the runtime check to see if the class exist:
if (NSClassFromString(@"UICollectionView"))
I am sure this problem didn't exist on my older box with Xcode 5 and 4.6 (OS X Lion). But I simply can't get it now, and this issue is driving me crazy as it leaves me without iOS 5 support.
What to do?
Upvotes: 0
Views: 232
Reputation: 6969
I got around the problem by linking UIKit as Optional framework instead of Required.
Strange, but true.
Upvotes: 0
Reputation: 1300
Have you tried checking if you can call the method. I use this sort of thing:
if ([UICollectionView instancesRespondToSelector:@selector(UICollectionElementKindSectionHeader:)])
Or something like that ?
Upvotes: 0