UITextField input issue

There are two Outlets in my app, one is UItextfield, the other is UIWebview, a textbox used to receive a url request by the user and shown in a webview, but I am facing a problem when I finish typing in my textbox and click the button GO (return) on my keyboard that nothing happens in my web browser, my original code is as below:

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    NSLog(@"clicked");
    [textField resignFirstResponder];
    [mywebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[textField text]]]];

    return YES;
}

      

What is the problem?

0


source to share


1 answer


Have you set up a textfield delegate class with a textFieldShouldReturn: method ??



0


source







All Articles