• 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: Newbie Q: Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Q: Bindings


  • Subject: Re: Newbie Q: Bindings
  • From: Matt Neuburg <email@hidden>
  • Date: Thu, 25 May 2006 14:20:37 -0700
  • Thread-topic: Newbie Q: Bindings

On Thu, 25 May 2006 10:39:40 -0400 (EDT), Tim Gray <email@hidden>
said:
>  myIFFFileInstance = [[IFFClass alloc] initWithFilePath: filePath];
>\\ At this point myIFFFileInstance has a bunch of instance variables (like
30-40) that I would like to display in textfields...
>  [secondTextField setStringValue:   \\
>   [myIFFFileInstance getInstanceVariableAsString]];
>  [myIFFFileInstance autorelease];

>Hope that makes sense.  This works fine.  However, I'd like to it with bindings

You'll want to alter your architecture, then, since the idea of bindings is
that two existing things are coordinated. The myIFFFileInstance comes into
existence and goes out of existence, so that it is not an "existing thing".
So you might want your myIFFFileInstance instead to be instantiated in the
nib and to stay in existence. Then, still in the nib, you can just bind the
text field's value to an ivar of the myIFFFileInstance.

So, in code, you're going to tell the myIFFFileInstance about the filePath,
and it is going to set its own ivars, and hey presto, the text field will
simply display the ivar in question. m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
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

  • Prev by Date: Re: Problem getting the launch identifier
  • Next by Date: Re: inconsistant AppleScript
  • Previous by thread: Newbie Q: Bindings
  • Next by thread: inconsistant AppleScript
  • Index(es):
    • Date
    • Thread