NSInvalidArgumentException - non comptabilisés sélecteur envoyé à l'instance? UITextView / UIPickerView

Je suis en train de mettre en place un champ de texte qui remplit un pickerView avec les utilisateurs d'entrée. J'obtiens cette erreur à chaque fois que je lance l'application:

NSInvalidArgumentException', reason: '-[UITextField isEqualToString:]: unrecognized   selector sent to instance.
@synthesize pickerView;
@synthesize textArray;
@synthesize textField;
- (void)viewDidLoad
{
[super viewDidLoad];
self.textArray = [[NSMutableArray alloc] init];
PFUser *currentUser = [PFUser currentUser];
if (currentUser) {
NSLog(@"Current user: %@" , currentUser.username);
}
else {
[self performSegueWithIdentifier:@"showLogin" sender:self];
}
self.textField.delegate = self;
self.pickerView.dataSource = self;
self.pickerView.delegate = self;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:@selector(keyboardWillShow:) name:
UIKeyboardWillShowNotification object:nil];
[nc addObserver:self selector:@selector(keyboardWillHide:) name:
UIKeyboardWillHideNotification object:nil];
self.tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(didTapAnywhere:)];
}
-(void)didTapAnywhere: (UITapGestureRecognizer *) note {
[self.textField resignFirstResponder];
}
-(void) keyboardWillShow:(NSNotification *) note {
[self.view addGestureRecognizer:self.tapRecognizer];
}
-(void) keyboardWillHide:(NSNotification *) note
{
[self.view removeGestureRecognizer:self.tapRecognizer];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 1;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:   (NSInteger)component
{
if ([self.textArray count] == 0)
return 1;
return [self.textArray count];
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:   (NSInteger)component {
return [self.textArray objectAtIndex:row];
}
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row forComponent:    (NSInteger)component{
NSLog(@"You selected this: %@", [self.textArray objectAtIndex:row]);
}
-(void)textFieldDidEndEditing:(UITextField *)textField{
[self.textArray addObject:self.textField.text];
[self.textField resignFirstResponder];
}
- (IBAction)logout:(id)sender {
[PFUser logOut];
[self performSegueWithIdentifier:@"showLogin" sender:self];
}
@end

Je suis nouveau à tout, alors allez facile sur moi si c'est quelque chose de base qui, elle l'est probablement. Cheers!

  • Êtes-vous en mesure de publier l'ensemble de la trace de la pile pour que l'exception? Cette ligne seul n'aide pas avec le code que vous avez posté (comme dans, vous appelez isEqualToString: n'importe où?)
  • je ne sais pas si c'est l'info qui permet de. Je suis littéralement comme seulement une bonne semaine dans cette programmation chose et savent très peu sur le débogage et ainsi de suite.
  • Cela ne veut pas aider un peu, j'ai peur, mais votre question a été posée ci-dessous.
  • Bien sûr, vous pouvez lire plus au sujet de base iOS débogage raywenderlich.com/10209/my-app-crashed-now-what-part-1
InformationsquelleAutor Jared Gross | 2013-08-29