• 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: How to use NSImageView bindings placeholders?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use NSImageView bindings placeholders?


  • Subject: Re: How to use NSImageView bindings placeholders?
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 8 Feb 2006 12:32:53 -0600

On 3 Feb 2006, at 9:28 AM, Guy Umbright wrote:

I have an NSImageView with the 'valuePath' binding set and it works as expected when the path
points to a graphic file. What I would like is a default graphic be displayed when the path is not
a graphic file. Would the 'Not applicable' binding be of use here? If so how? The bindings reference
say the value should be an NSNumber, but how would that be meaningful? A pointer to an NSImage
(set programatically)?

Guy,

In the January 2006 version of the developer documentation, NSImageView bindings list valuePath as a string.

I'd try an NSValueTransformer that validates the proposed path and returns nil (or, better, the path to the bundle's default picture file) if it doesn't point to a graphic. If you go with returning nil, specify (possibly at awakeFromNib time) the default picture for the null-value condition.

	-- F


-- Fritz Anderson -- http://www.manoverboard.org/ Consulting Programmer -- http://resume.manoverboard.org/ Step into Xcode, Now Available -- http://six.manoverboard.org/


_______________________________________________ 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: 
 >How to use NSImageView bindings placeholders? (From: Guy Umbright <email@hidden>)

  • Prev by Date: Need help with Japanese (two-byte system) problem
  • Next by Date: Re: autosizing fun
  • Previous by thread: How to use NSImageView bindings placeholders?
  • Next by thread: Default directories for multiple NSSavePanels
  • Index(es):
    • Date
    • Thread