当我使用alertView
下面的代码时,它会向我显示警告
warning: Semantic Issue: Method '-addTextFieldWithValue:label:' not found (return type defaults to 'id')
这是代码:
UIAlertView *alSave=[[UIAlertView alloc]initWithTitle:@"Save as" message:@"Title the note and click Save" delegate:self cancelButtonTitle:@"save" otherButtonTitles:@"cancel", nil];
NSArray *arr=[noteObj.noteTitle componentsSeparatedByString:@" - "];
app.longClickId = [noteObj.noteId integerValue];
[alSave addTextFieldWithValue:[NSString stringWithFormat:@"%@",[arr objectAtIndex:0]] label:@"Note Name"];
// show me warning at this place
textField = [alSave textFieldAtIndex:0];
textField.keyboardType = UIKeyboardTypeAlphabet;
textField.keyboardAppearance = UIKeyboardAppearanceAlert;
textField.autocorrectionType = UITextAutocorrectionTypeNo; // correction automatically
[alSave show];
if (app.NotePopOver!= nil) {
[app.NotePopOver dismissPopoverAnimated:YES];
}
[alSave release];