views:

29

answers:

1

I have a view with 2 textfields in it. The first one should get URL's, the second words to be searched on google. The problem is that the following method -(BOOL)textFieldShouldReturn:(UITextField *)textField; designs the behavior for both of them. What should I do in order to be able to design two behaviors just as I mentioned above (URL opening and google searching).

+3  A: 

You only have one set of delegate methods, they take as an argument the textfield. Switch on the tag (set each tag to be different numbers than the other). Take appropriate action based on the tag value.

jer