• 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: Performing the selector from a stored IMP
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Performing the selector from a stored IMP (From: Matt Neuburg <email@hidden>)
 >Re: Performing the selector from a stored IMP (From: Joanna Carter <email@hidden>)
 >Re: Performing the selector from a stored IMP (From: Matt Neuburg <email@hidden>)
 >Re: Performing the selector from a stored IMP (From: Joanna Carter <email@hidden>)

  • Prev by Date: Re: [ANN] Cong 0.7
  • Next by Date: specifying new document types that an app opens
  • Previous by thread: Re: Performing the selector from a stored IMP
  • Next by thread: NSTreeNode mutableChildNodes documented as observable using key-value observing
  • Index(es):
    • Date
    • Thread