• 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
setValue:forKey: and invocation forwarding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setValue:forKey: and invocation forwarding


  • Subject: setValue:forKey: and invocation forwarding
  • From: Graham Cox <email@hidden>
  • Date: Tue, 13 Jul 2010 22:53:59 +1000

It appears that calling -setValue:forKey: on an object bypasses or ignores any invocation forwarding it has set up, unless I'm missing some obvious error.

I have an object that acts as a wrapper for another object, and so that the wrapper can, under some circumstances, act as the thing it is wrapping, it implements invocation forwarding using the 'classic' approach of overriding -respondsToSelector:, -methodSignatureForSelector: and -forwardInvocation: but when I call -setValue:forKey: on the wrapper (where key is implemented by the thing wrapped), it throws the 'not key-value coding compliant for key' exception. The stack trace appears to show that this failure occurs before it has even attempted to follow the forwarded path. However if I simply call the wrapped property setter directly, the forwarding works. As this needs to work on 10.5, I can't use the 10.6 solution of -forwardingTargetForSelector: (not that I've tested it to see if it exhibits the same issue or not).

Is this the expected behaviour?

--Graham


_______________________________________________

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: setValue:forKey: and invocation forwarding
      • From: Fritz Anderson <email@hidden>
    • Re: setValue:forKey: and invocation forwarding
      • From: glenn andreas <email@hidden>
    • Re: setValue:forKey: and invocation forwarding
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Testing background task expiration; lowering backgroundTimeRemaining?
  • Next by Date: Re: NSViewController and key value coding
  • Previous by thread: Re: Testing background task expiration; lowering backgroundTimeRemaining?
  • Next by thread: Re: setValue:forKey: and invocation forwarding
  • Index(es):
    • Date
    • Thread