• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to know when a UISwitch is being touched
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to know when a UISwitch is being touched


  • Subject: How to know when a UISwitch is being touched
  • From: Joan Lluch-Zorrilla <email@hidden>
  • Date: Tue, 31 Mar 2009 15:22:00 +0200

I need to know whether the user is touching inside a UISwitch control. The UIControlEvent(s) do fire, but then isTouchInside always gives NO. My code is:

- (void)switchTouched:(UIControl *)sender
   {
    NSLog( @"switchtouched:%d", [sender isTouchInside]) ;
   }

The switchTouched method was added as a target to touch events upon creation of the switch like this

[switchv addTarget:self action:@selector(switchTouched:) forControlEvents:UIControlEventAllTouchEvents] ;

Whatever the user does on the switch the result is always Zero. What am I missing?

Joan Lluch-Zorrilla



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Best way to modify user input into NSTextView
  • Next by Date: Re: Need help for user interface in COCOA + Objective C
  • Previous by thread: Re: Best way to modify user input into NSTextView
  • Next by thread: Thanks!
  • Index(es):
    • Date
    • Thread