Try this if you want to use UIAlertController along side UIAlertView or UIActionSheet for your iOS 6 and above project.
It compiled for me in Xcode 7.3 as well as in Xcode 5.1.
Class UIAlertControllerClass = NSClassFromString(@"UIAlertController"); //So that Xcode 5 won't complain about not knowing what is UIAlertController.
if (UIAlertControllerClass)
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 //So Xcode 5 won't worry about your UIAlertController code since it was introduced in iOS 8.
//UIAlertController code goes here.
#endif
}
else
{
//UIAlertView or UIActionSheet code goes here.
}