uitextfield дважды запускает textFieldShouldBeginEditing на iPhone в автономном режиме - PullRequest
2 голосов
/ 27 августа 2010

Я не могу понять, почему мое приложение запускает метод делегата UITextField textfieldshouldbeginEditing дважды, когда я нахожусь в режиме полета и идеях.

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField 
{
    NSLog(@"TFSBE profile Table = %i", textField.tag);
    if ([[[UIApplication sharedApplication] delegate] checkInternet]) 
    {
        return YES;
    }
    else 
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Online" message:@"You Cannot change your User Name while not online" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [alert show];
        [alert release];
        return NO;
    }
}

- (void)textFieldDidEndEditing:(UITextField *)textField 
{
    //[textField resignFirstResponder];
    NSString *text = [textField text];

    switch ([textField tag]) ....... do stuff
    [self.tableView reloadData];
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField 
{ 
    //[textField resignFirstResponder];
    return YES;
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...