• 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: How to implement an object whose properties are really dictionary entries.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to implement an object whose properties are really dictionary entries.


  • Subject: Re: How to implement an object whose properties are really dictionary entries.
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 12 Jul 2012 14:40:58 -0700

On Jul 12, 2012, at 2:32 AM, Motti Shneor <email@hidden> wrote:

> I already have dealt with forwardInvocation, in another class (some kind of NSNotificationCenter replacement which dispatches messages to registered objects, in prioritized and synchronized way). I think I can do it without much hassle.

-forwardInvocation: is REALLY slow. It has to try every other way to find the method, then look up the method signature, extract the parameters from the stack frame, create an NSInvocation object, copy all the parameters into it, then call -forwardInvocation:.

By comparison, creating the methods at runtime is comparably slow on the first call, then much faster after that. It's still going to be slower than a regular method call because the implementation has to figure out which method you were calling and map that to a property name, but it's not as bad.

—Jens

_______________________________________________

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: How to implement an object whose properties are really dictionary entries.
      • From: Kyle Sluder <email@hidden>
References: 
 >How to implement an object whose properties are really dictionary entries. (From: Motti Shneor <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Keary Suska <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Dave DeLong <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Keary Suska <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Motti Shneor <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Keary Suska <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Motti Shneor <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Quincey Morris <email@hidden>)
 >Re: How to implement an object whose properties are really dictionary entries. (From: Motti Shneor <email@hidden>)

  • Prev by Date: Re: Quit helper app when main app terminates
  • Next by Date: Re: How to implement an object whose properties are really dictionary entries.
  • Previous by thread: Re: How to implement an object whose properties are really dictionary entries.
  • Next by thread: Re: How to implement an object whose properties are really dictionary entries.
  • Index(es):
    • Date
    • Thread