I am trying to override the init method for a UIAlertView and customize it and I am getting the following warning? “Missing sentinel in method dispatch”.
What does this warning mean, and how can I resolve it?
- (id)initWithTitle:(NSString *)title
message:(NSString *)message
delegate:(id)delegate
cancelButtonTitle:(NSString *)cancelButtonTitle
otherButtonTitles:(NSString *)otherButtonTitles, ...
{
if (self = [super initWithTitle:title
message:message
delegate:delegate
cancelButtonTitle:cancelButtonTitle
otherButtonTitles:otherButtonTitles])
{
// Customize alertView
}
return self;
}
Take a look at the
UIAlertViewdocumentation, in particular:This means overriding the
initWithTitlemethod isn’t going to be useful. You’ll need to try another approach – perhaps if you share what you’re trying to achieve people might be able to suggest an alternative (for example, using a category).