Missing sentinel in UIAlertView allocation
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Error"
message:@"Some failure message"
开发者_C百科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 on alert
.
Since you include nil
after otherButtonTitles
, you should not get a missing sentinel warning.
精彩评论