开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜