• 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: Should I be trying to use bindings for this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should I be trying to use bindings for this?


  • Subject: Re: Should I be trying to use bindings for this?
  • From: "I. Savant" <email@hidden>
  • Date: Wed, 3 Oct 2007 13:19:07 -0400

> >   Why is this a problem? Are you aware that NSArrayController passes
> > you a *proxy* object that represents your actual object?
>
> Shamefully, no. I'll go re-re-read about NSArrayControllers.

  I can't recall, but I *believe* this is mentioned in the
documentation. You can find undocumented (private API) ways of getting
at the object directly via the proxy, but ... yuck.

> Because later, when I want to schedule a workOrder, my app has to
> step through all the orderSteps of that order to see what
> operationType they are, and I have to check to see what workCenters
> are available to take on each of those steps. In order to see if a
> workCenter is able to do that kind of work, I look to see if the
> workCenter's operationTypes array contains the same operationType as
> is required by the orderStep.

  Okay, so if you ask for its orderSteps using -valueForKey: or
-valueForKeyPath: you should get what you're looking for (ie, no
proxy). You can ask the proxy for any KVC-compliant property and
you'll get real objects in response. I'm not sure based on your
description if this is sufficient for your purposes, but it's worth
mentioning.

  Caveat: I may totally be misunderstanding your description. Take the
above with a grain of salt.

> It could very well be that I am Doing It Wrong™. I am very open to
> hearing how I might do it better.

  Almost certainly. :-)

--
I.S.
_______________________________________________

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: Should I be trying to use bindings for this?
      • From: Paul Bruneau <email@hidden>
References: 
 >Should I be trying to use bindings for this? (From: Paul Bruneau <email@hidden>)
 >Re: Should I be trying to use bindings for this? (From: "I. Savant" <email@hidden>)
 >Re: Should I be trying to use bindings for this? (From: Paul Bruneau <email@hidden>)

  • Prev by Date: NSSavePanel's required/allowed types
  • Next by Date: Re: Mapping ABPerson to Sync Services
  • Previous by thread: Re: Should I be trying to use bindings for this?
  • Next by thread: Re: Should I be trying to use bindings for this?
  • Index(es):
    • Date
    • Thread