Re: Performing the selector from a stored IMP
Re: Performing the selector from a stored IMP
- Subject: Re: Performing the selector from a stored IMP
- From: Bill Bumgarner <email@hidden>
- Date: Fri, 11 Feb 2011 14:52:28 -0800
On Feb 11, 2011, at 1:16 PM, Joanna Carter wrote:
> I would totally agree that it is a phenomenally powerful concept, giving just the kind of functionality I was originally looking for, as a replacement for method pointers. I will be using it as soon as I find a need that warrants it.
>
> But, in my current code, I realise now that it was a lot easier to simply take the protocol/method approach.
While fast, IMP caching can also be dangerous. If anything happens such that the IMP changes while you have it cached, you'll end up calling the wrong thing.
In particular, if you cache an IMP for something that can be observed with KVO, it can lead to problems.
Bundle loading can also be an issue; categories can replace IMPs. Obviously, method swizzling -- in general -- will cause issues.
(Just an FYI -- none of these are *huge* issues, just something to be aware of)
b.bum
_______________________________________________
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