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

MythicFrost

macrumors 68040
Original poster
Mar 11, 2009
3,944
40
Australia
OK, I've managed to create a menu I'm happy with. I want it so when I click Play it calls a function, I'm wondering though, how do I do that?
I've found [bPlay touchesBegan] but I'm not sure what to do with the parameters that it wants.
Code:
[bPlay touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event];

Can anyone help? Thanks.

EDIT: figured it out with Google :)
Code for anyone that needs it:
Code:
[bPlay addTarget:self action:@selector(bPlay_TouchDown) forControlEvents:(UIControlEvents)UIControlEventTouchDown];

- (void)bPlay_TouchDown {
}

The example code had @selector(bPlay_TouchDown:) but it made my app crash, I think it's because my function doesn't have any arguments.
 
Typically you want a button to send its action message on touch up inside, not on touch down.

If this is new to you then you should get one of the books on iPhone development.
 
I would like to get a book, but for now I'll keep doing what I'm doing.
I'll change it to Touch Up Inside then, thanks :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.