• 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: Is this the correct way to cache an IMP?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this the correct way to cache an IMP?


  • Subject: Re: Is this the correct way to cache an IMP?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Thu, 5 Aug 2010 15:47:05 +0200

Le 5 août 2010 à 15:37, Graham Cox a écrit :

>
> On 05/08/2010, at 11:14 PM, Ken Thomases wrote:
>
>> If you don't need to support subclassing and overriding of this method, just move its body to a function, and have the method be a thin wrapper around the function.
>
>
> The problem with that is that other parts of the method access private ivars of the object, which would need to be made available to the external function - the accessors for those would probably eliminate the gains made by avoiding the message dispatch for the recursion. The alternative of making the ivars public and just using pointer syntax is a way around that, but feels like a hack too far (unless there's a way to scope the function so that it can 'see' private ivars, but I'm not familiar with how that would be done).

As I pointed in my previous post, just define the function inside your class body (between @implementation and @end), and you will be able to access private ivars using pointer syntax.

-- Jean-Daniel




_______________________________________________

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: Is this the correct way to cache an IMP?
      • From: Graham Cox <email@hidden>
    • Re: Is this the correct way to cache an IMP?
      • From: Ken Thomases <email@hidden>
References: 
 >Is this the correct way to cache an IMP? (From: Graham Cox <email@hidden>)
 >Re: Is this the correct way to cache an IMP? (From: Ken Thomases <email@hidden>)
 >Re: Is this the correct way to cache an IMP? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Is this the correct way to cache an IMP?
  • Next by Date: Re: Is this the correct way to cache an IMP?
  • Previous by thread: Re: Is this the correct way to cache an IMP?
  • Next by thread: Re: Is this the correct way to cache an IMP?
  • Index(es):
    • Date
    • Thread