Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

art0071

macrumors newbie
Original poster
May 20, 2009
10
0
Hello Guys,

I am starting to plan now for the driven language
and I object to a question that should be simple for you.

Somebody could give me some advice on this:

I have 2 UiTextField in the window, for each of them I created a
"Outlet" and joined the names of txt1 and txt2.

I created an IBAction and joined the event "did Begin Editing"
for txt1 and txt2

- (IBAction) trocarImagem (id): sender


I would like to know how do I get the txt1 and test it
by name.
Something like this:? if (sender.name == "txt1") ...

Thanks
 
The sender value is the object pointer of the control that sent the action. Something like this should work

Code:
if (sender == txt1)

BTW, don't compare NSStrings with ==

Code:
if ([sender.name isEqualToString: @"txt1"])

but textfields don't have names.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.