• 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: binding with tranformer question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding with tranformer question


  • Subject: Re: binding with tranformer question
  • From: Charilaos Skiadas <email@hidden>
  • Date: Fri, 29 Jul 2005 10:51:34 -0500

On Jul 29, 2005, at 6:38 AM, Theodore Petrosky wrote:

two classes.
vendorcategories and vendorinfo (with two array
controllers)

vendorinfo has instances of:
vcode, vname, vaddress, vstate, vzip, vcategory (with
setters and getters)

vendorcategories has instances of:
vendorcategoryname, vendorcategorycode (with setters
and getters)

Sorry, allow me to correct a grammatical mistake, you have two entities (that give rise to classes), but what you are mentioning are not *instances* of the classes, they are *instance variables*. vendorinfo0,vendorinfo1, etc are your instances. Anyway, to the question at hand,
I create an array of vendorinfo from a database query.
so my array is

vendorinfo0
vendorinfo1
vendorinfo2

and I get an array of vendorcategories

vendorcategories0
vendorcategories1
vendorcategories3   etc.


my popup is popuplated from vendorcategories and the selectedObject is bound to vendorinfo. however vendorinfo only has the code (I guess I could de-normalize the database to get the project moving but I want to figure this out) ... I want to display the name from the code.

Why does it only have the code? It should have the vendorcategory, since that is what you have populated your popup with. If you have populated it with vendorcategory.vendorcategorycode, then you shouldnt have.
What I mean is, there is the content binding for the popup, which should be bound to arrangedObjects of the conroller handling vendorcategory objects.
Then there is the contentValues binding for the popup, which should be bound to arrangedObjects of the same controller, with model key path whatever you want to appear in the pop-up as options, so if you want the codes there, you should have vendorcategorycode as a path. That way, you are seeing the codes, but selecting the categories.


That is, if I understood what you were trying to do. If this is what you want to do, then you should not need any valueTransformer, this is one of the most standard uses for bindings in pop-ups

Maybe I've completely misunderstood? You just want to be able to select a category for each vendorInfo, through a pop-up, right?

Btw, if these are indeed entities, then you might want to just option- drag the entities to the interface window so that the UI is automatically created, then see what connections are set there, and set them programmatically.

On an unrelated note, why are you doing this programmatically? I am sure there are reasons, just curious to find out.

Haris


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: binding with tranformer question (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: New looks [not] replacing Metal?
  • Next by Date: Core data - one relationship is not saved
  • Previous by thread: Re: binding with tranformer question
  • Next by thread: Using Bindings for an Inspector
  • Index(es):
    • Date
    • Thread