push on push off button

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

  1. spire.bt macrumors newbie

    Apr 8, 2010
    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


    Staff Member

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


    Feb 11, 2010
    BOOL buttonPressed;

    - (IBAction) pressButton: (id) sender {

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


Share This Page