• 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: transformers? revisited but getting there..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: transformers? revisited but getting there..


  • Subject: Re: transformers? revisited but getting there..
  • From: Theodore Petrosky <email@hidden>
  • Date: Mon, 20 Sep 2004 05:09:05 -0700 (PDT)

Thanks Tod,

I had just seen a few posts that spoke of using the
index...

It appears to me that a tranformer is not really a
'class' that I can access. A better solution (if
available) is to create the transformer, them pass it
the values to transform after  I query the database. I
can not figure out how to talk to the transformer..

Is this possible?

Ted

--- Tod Cunningham <email@hidden> wrote:

> You could definitely use a two way transformer to do
> this, but as as
> you mentioned the transformer would be an issue if
> you don't know the
> mapping of clientnames to clientcodes without the
> database query.  You
> could also query the arraycontroller to get the
> selected object and
> then extract the clientcode yourself:
>
> 	CLLogEntry *contact = [[logArrayController
> selectedObjects]
> objectAtIndex:0];
> 	int         code    = [contact clientcode];
>
> This assume your arraycontroller returns an object
> of type CLLogEntry,
> but just use whatever class arraycontroller is
> mapped to return (such
> as NSMutableDictionary.  You can then get the
> selected clientcode and
> do whatever you want with it.
>
> Remember to bind the contentArray of the controller:
>
>      [logArrayController bind:@"contentArray"
> toObject:logBook
> withKeyPath:@"logEntryList"   options:nil];
>
>
> Hope that helps a little, you could also easily do a
> one way transform
> from CLLogEntry to int (code) if that helps you!!!
>
> - Tod
>
> On Sep 19, 2004, at 12:32 PM, Theodore Petrosky
> wrote:
>
> > I need some help with transforms and bindings.
> >
> > a little history:
> >
> > I have a popup managed by an arraycontroller. the
> > array is created by querying a database and
> retrieving
> > a list of clientnames and clientcodes. I then bind
> the
> > clientnames to the popup. my problem is that when
> I
> > change the popup, I need the clientcode to be
> updated
> > in the selection.loggedInByCode in the main
> > controller.
> >
> > I have used NSTransformers for this before however
> I
> > don't know how to get the transform values into
> the
> > transformer.
> >
> > The question is, am I barking up the wrong tree
> with
> > using the transformerValues.
> >
> > Is there an easier way to bind the clientNamePopUp
> in
> > such a way that if I select a new clientname, the
> > clientcode gets updated also.
> >
> > my 'schema' is like this.
> >
> > mainJobArray =
> >
> > jobNumber
> > clientNmae
> > clientCode
> > loggedindate
> > proofdate
> > finaldate
> >
> > the popupcontroller is bound to:
> >
> > clientname
> > clientcode
> >
> > where I am displaying the clientname in the popup.
> > This array is created on the fly from the database
> and
> > can change so I can not create a transformer that
> is
> > hard coded.
> >
> > Am I clear? How can I accomplish this?
> >
> > Ted




_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
 _______________________________________________
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

  • Follow-Ups:
    • Re: transformers? revisited but getting there..
      • From: Tod Cunningham <email@hidden>
References: 
 >Re: transformers? revisited but getting there.. (From: Tod Cunningham <email@hidden>)

  • Prev by Date: Re: NSAppKitVersionNumber for 10.3.0?
  • Next by Date: Re: NSAppKitVersionNumber for 10.3.0?
  • Previous by thread: Re: transformers? revisited but getting there..
  • Next by thread: Re: transformers? revisited but getting there..
  • Index(es):
    • Date
    • Thread