On Aug 29, 2012, at 5:54 PM, Uli Kusterer <[email protected]> wrote: > On Aug 25, 2012, at 1:58 AM, Fritz Anderson <[email protected]> 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).
Of course, with ObjC methods, the method name would change in that case, but this is the entire reason why -performSelector:withObject:afterDelay: can be used on selectors that take no parameters. You pass in a NIL parameter, but the called method just never looks at it. Of course, technically the call could look at the selector name, and if it does not have the trailing colon, simply pass one parameter less. Cheers, -- Uli Kusterer "The Witnesses of TeachText are everywhere..." http://www.zathras.de _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
