• 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: value transformer for structs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: value transformer for structs?


  • Subject: Re: value transformer for structs?
  • From: "John C. Randolph" <email@hidden>
  • Date: Wed, 22 Mar 2006 23:19:58 -0800


On Mar 22, 2006, at 9:07 PM, Michael B Johnson wrote:

I'm assuming I'm missing something obvious, but let's say I have an object that returns a struct (like an NSRect, or better yet, a QTTime) that I want to use bindings to show in the UI.

Looking at the doc it seems (understandably) expecting objects.

Can I do this, or should I have my class return that thing as an NSString or somesuch?

Value transformers do have to take and return objects. For an NSRect, I've used NSRectFromString() and NSStringFromRect() to go back and forth with string representation. There are equivalent also point, range, and size functions. As it happens, there's also a QQTimeFromString() function.


-jcr

John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.



_______________________________________________
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: value transformer for structs?
      • From: Michael B Johnson <email@hidden>
References: 
 >value transformer for structs? (From: Michael B Johnson <email@hidden>)

  • Prev by Date: Re: NSTimer fires after invalidated - why?
  • Next by Date: Re: NSTimer fires after invalidated - why?
  • Previous by thread: Re: value transformer for structs?
  • Next by thread: Re: value transformer for structs?
  • Index(es):
    • Date
    • Thread