Tak, dostałem ten problem. Opracowałem swój kod w iOS7, ale musiałem zrobić to również z iOS 8. Więc natknąłem się na This link. Mam moje rozwiązanie w następujący sposób:
Podczas pracy z iOS7 UIAlertView działa dobrze, ale jeśli pracujesz z iOS8, musisz użyć UIAlertController. Użyj tego rodzaju kodu:
if(SYSTEM_VERSION_LESS_THAN(@"8.0"))
{
alert = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"Invalid Coupon." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
else
{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Invalid Coupon." preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"OK", @"OK action")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action)
{
}];
[alertController addAction:okAction];
[self presentViewController:alertController animated:YES completion:nil];
}
Mam nadzieję, że to ci pomoże.
Dzięki @iAnurag: D – Salmo
Witamy. miło, że mogłem pomóc – iAnurag