UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Error"
message:@"Some failure message"
delegate:self
cancelButtonTitle:@"cancel"
otherButtonTitles:@"retry", nil
];
[alert show];
[alert release];
I got two warnings pointing at this block of code.
- Unused variable ‘alert’
- Missing sentinel in function call
My code looks similar to all the examples online. Why is it broken?
This code works fine for me. Try cleaning all targets and building again to see if the error persists.
Because you call
[alert show], you should not get an unused variable warning onalert.Since you include
nilafterotherButtonTitles, you should not get a missing sentinel warning.