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

andyiapan

macrumors newbie
Original poster
Feb 28, 2010
29
0
i have designed 10 UIbutton,

if i want to manage all different touch event between them.

how can i use
Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {  
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {  
}
and

Code:
- (IBAction) button1:(id)sender{    }
- (IBAction) button2:(id)sender{    }
- (IBAction) button3:(id)sender{    }
.........

handle all different touch event on different button?

Many Thanksss~
 
Last edited by a moderator:

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
I've added [code] tags to make the code a lot easier to read.

To do this either type [code]...your code here...[/code]

Or press the code button
code.gif
when making your post.

:)

P.S. Is this thread not related to your previous thread?: Move and touch event problem on UIButton
 

cnstoll

macrumors 6502
Aug 29, 2010
254
0
Um, you could wire up the event selectors for various button events in Interface Builder to correspond to the desired IBAction methods that you've written...or does that not work?
 

andyiapan

macrumors newbie
Original poster
Feb 28, 2010
29
0
Um, you could wire up the event selectors for various button events in Interface Builder to correspond to the desired IBAction methods that you've written...or does that not work?

i wanna set when i touch down the button and move up, it will come out a result,
if move down , come out another result, how can i do that?

Thanks~~
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.