I want to use a Core Foundation method that is only available on the latest iOS SDK, and fallback to a different one for previous SDKs. Is there something similar to Cocoa’s way of doing it for NSObject?:
- (BOOL)respondsToSelector:(SEL)aSelector
A bit more of context, let’s say ABAddressBookCreate() would only be available in iOS5, and my app is targeting iOS 4.3+. I would want to check if ABAddressBookCreate() is available at runtime and perform different actions depending on that.
Try this (doesn’t need weak linking):
If you can provide weak linking: