-1

I use a UIAlertView to show an alert in iPhone6. where delegate is called nil. When I pressed the ok button of alert then it's automatically crashed and there is no error message. It only shows EXC_BAD_ACCESS(code=EXC_I386_GPFLT).

Given bellow the code:

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"This First ALert" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show]; 
Paddy
  • 766
  • 5
  • 16
  • 1
    If you don't pass any `otherButtonTitles` then only one `nil` is sufficient at the end of method call :) – Losiowaty Sep 16 '15 at 13:25
  • Please read this question answer link: http://stackoverflow.com/questions/19651788/whats-the-meaning-of-exception-code-exc-i386-gpflt – Lalji Sep 16 '15 at 13:26

2 Answers2

0

Please check it.

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"This First  ALert" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show]; 

Thanks :)

Rupal Patel
  • 570
  • 6
  • 13
0

You just added extra nil into otherButtonTitles

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"This First ALert" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show]; 

Hop this helps.

Tejas Ardeshna
  • 4,343
  • 2
  • 20
  • 39