I'm implementing the new core location permissions for iOS 8, but I would like to compile and ship using Xcode 5.1.1 and the iOS 7.1 SDK.
Specifically, I want to call the method "requestWhenInUseAuthorization" on CLLocationManager, which is only available in iOS 8.
What are the risks to doing it this way? Is this a good practice? Can I ignore the 'Undeclared Selector' warning?
// Warning: Undeclared Selector
SEL requestWhenInUse = @selector(requestWhenInUseAuthorization);
if( [self.sharedLocationManager respondsToSelector:requestWhenInUse] )
{
// Warning: May cause leak because selector is unknown
[self.sharedLocationManager performSelector:requestWhenInUse];
}
[self.sharedLocationManager startUpdatingLocation];