views:

42

answers:

1

I have defined the following method:

- (IBAction)actionPerformed: (id)sender { ... }

and registered it with several widgets (UIButtons mostly) on a view. I'd like to log a message telling me who triggered which UIControlEvents, e.g.

NSLog( @"The following: %@ was triggered by %@\n", <control events>, <button identifier> );

I don't want to use title as some of the button might share the same title; is there an equivalent to the id on an HTML element?

And I couldn't find a way to extract the UIControlEvents from the sender/UIButton. Any ideas?

A: 

This is what I have been using to find out which button called my 'pressed' function (it's linked to 64 buttons...) I'm not sure about finding out which function did it though... Hope this helps!

-(IBAction) pressed:(id)sender {
UIButton *button = (UIButton *)sender;
{NSLog (@"blah blah blah %@, sender) etc }

Emily Hughes