开发者

uitextfield runs textFieldShouldBeginEditing twice on iPhone when Offline

I can't figure out why my app runs the UITextField delegate Method textfieldshouldbeginEditing twice when i am in airplane mode and ideas.

- (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;
 开发者_StackOverflow中文版   }
}

- (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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜