manage UIButton touch

Discussion in 'iOS Programming' started by andyiapan, Dec 3, 2010.

  1. andyiapan, Dec 3, 2010
    Last edited by a moderator: Dec 3, 2010

    andyiapan macrumors newbie

    Joined:
    Feb 28, 2010
    #1
    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~
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    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 [​IMG] when making your post.

    :)

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

    Joined:
    Aug 29, 2010
    #3
    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?
     
  4. andyiapan thread starter macrumors newbie

    Joined:
    Feb 28, 2010
    #4
    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~~
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Isn't that what your other thread is about? Please don't make separate threads that really cover the same topic.
     

Share This Page