how do you suppose targetViewControllerForAction:sender: works?
how do you suppose targetViewControllerForAction:sender: works?
- Subject: how do you suppose targetViewControllerForAction:sender: works?
- From: Matt Neuburg <email@hidden>
- Date: Thu, 09 Oct 2014 09:56:08 -0700
From the WWDC 2014 video 216: "targetViewControllerForAction works by looking at the View Controller and seeing if it's _overwritten_ the action method that you've passed in."
From Kyle Sluder's blog: "-targetViewControllerForAction:sender: ... will then determine whether the instance’s method for that selector is an override of a UIViewController implementation for the same selector."
Those descriptions are correct. But then how do you suppose it does this? There's an introspective voodoo happening here that I've never seen before. `respondsToSelector:` obviously doesn't cut it: it would return YES if this class merely _inherits_ the ability to respond to this selector. How would you find out the answer to the question, "does this UIViewController subclass respond to this selector _differently_ from UIViewController?"
Thx - m.
--
matt neuburg, phd = http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do
iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
_______________________________________________
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