push on push off button

Discussion in 'iOS Programming' started by spire.bt, May 18, 2010.

  1. spire.bt macrumors newbie

    Joined:
    Apr 8, 2010
    #1
    is it possible to make a button push on push off on iphone application?
    I have a timer with two IBActions one is start and the other one is stop but I want to activate start and stop on the same button
    I know this is possible for mac applications :apple:
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    How about using a UIButton whose title toggles between Start and Stop?
     
  3. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #3
    BOOL buttonPressed;


    - (IBAction) pressButton: (id) sender {

    //Your UIButton that has been attached to an outlet
    myButton.selected = !buttonPressed;
    buttonPressed = !buttonPressed;

    }
     

Share This Page