views:

340

answers:

1

In my application there have two Outlet,one is UItextfield and another is UIWebview,textfield used to get the url request by the user and shown it in webview,but i met a problem is when finish the typing in my textfield, and click GO button(return) in the keyboard, that is nothing happen in my webview, my source code as shown in below:

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

    return YES; }

do anyone know what is the problem

A: 

Have you set the delegate of the textfield to be the class with the textFieldShouldReturn: method?

toast