0

I Using a Uialertview in my class.

Here is my code

UIAlertView *alertView   = [[UIAlertView alloc]initWithTitle:nil message:@"message" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alertView show];

But the problem is when I press the ok button, the alert hides, but the black background is still there.

Does anyone have the answer for this?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
Rahul Nair
  • 381
  • 4
  • 14

3 Answers3

1

Try this.

 UIAlertView * alertView = [[[UIAlertView alloc] initWithTitle:@"" message:@"message" delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil, nil] autorelease];
 [alertView show];
Bhavin_m
  • 2,746
  • 3
  • 30
  • 49
0

In Your Code [[UIAlertView alloc]initWithTitle:nil @"message" should initWithTitle:@"message"

Such Like,

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Your Title" message:@"Your Message Body !!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
iPatel
  • 46,010
  • 16
  • 115
  • 137
0

Try,

UIAlertView *alertView   = [[UIAlertView alloc]initWithTitle:@"" message:@"message" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alertView show];
Girish
  • 4,692
  • 4
  • 35
  • 55