当我使用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];
的可能重复[警告:“UIAlertView中”可能不响应“:标签:-addTextFieldWithValue”( http://stackoverflow.com/questions/2294910/warning-uialertview-may-not-respond-to-addtextfieldwithvaluelabel) – PengOne
并且'-textFieldAtIndex:'找不到(返回类型默认为'id') –
同样,你是使用无证或不存在的方法。检查文档。如果该方法不存在,则会发出警告,Apple可能会拒绝该应用程序。 – PengOne