• 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
Re: Have to specify (id)sender to action methods in OS X but not in iOS?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Have to specify (id)sender to action methods in OS X but not in iOS?


  • Subject: Re: Have to specify (id)sender to action methods in OS X but not in iOS?
  • From: Uli Kusterer <email@hidden>
  • Date: Wed, 29 Aug 2012 17:54:42 +0200

On Aug 25, 2012, at 1:58 AM, Fritz Anderson <email@hidden> wrote:
> UIKit was a fresh start in the past five-plus years. With a generation of experience, Apple apparently didn't think it was always useful to pass sender pointers. You can get away with declaring action methods without parameters (or with two) because UIKit supports it, as AppKit does not.


 Actually, I think it should work on AppKit as well: The current ABI on MacOS and iOS supports passing more parameters to a function than it actually takes. As long as the caller passes in the "sender" target, the called function can not declare it and be fine, it will just be ignored. (This isn't guaranteed by ANSI, so is not strictly correct code, but it does work on the Mac, iPhone and iPad and is documented to do so).

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de


_______________________________________________

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

  • Follow-Ups:
    • Re: Have to specify (id)sender to action methods in OS X but not in iOS?
      • From: Uli Kusterer <email@hidden>
References: 
 >Have to specify (id)sender to action methods in OS X but not in iOS? (From: Laurent Daudelin <email@hidden>)
 >Re: Have to specify (id)sender to action methods in OS X but not in iOS? (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Binding NSSegmentedControl selection to user defaults
  • Next by Date: Re: Have to specify (id)sender to action methods in OS X but not in iOS?
  • Previous by thread: Re: Have to specify (id)sender to action methods in OS X but not in iOS?
  • Next by thread: Re: Have to specify (id)sender to action methods in OS X but not in iOS?
  • Index(es):
    • Date
    • Thread