UIButton actions

0 views
Skip to first unread message

Jeff Hentschel

unread,
May 10, 2009, 7:05:36 PM5/10/09
to RTFM: Development for Mobile Devices
hey all-

I'm having a problem getting a UIButton to respond to a touch event.
Here is what I'm doing:

I have my main tableview code in one file and the headerview in
another file (so i can track touches).

I want to switch the selector for a button in the headerview to a
method in the tableview file. I've been trying to use something like
this from the tableview: [self.headerView.menuBtn addTarget:self
selector:@selector(addRecipe) action:UIControlEventTouchUpInside]; (or
something like that). Any ideas on why the selector never gets called?
Thanks.

DavidK

unread,
May 10, 2009, 7:09:06 PM5/10/09
to RTFM: Development for Mobile Devices
Dunno, have you tried giving the header a pointer to the parent and
setting the target to that?

Jeff Hentschel

unread,
May 10, 2009, 8:55:52 PM5/10/09
to RTFM: Development for Mobile Devices
Apparently because I was trying to add the action before setting up
the header view, it didn't like the target and selector I was setting,
but once I set up the header before, everything started working.

On May 10, 6:05 pm, Jeff Hentschel <hentschel.j...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages