• 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: NSValueTransformer used with table colulms
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSValueTransformer used with table colulms


  • Subject: Re: NSValueTransformer used with table colulms
  • From: Bjoern Kriews <email@hidden>
  • Date: Thu, 25 Mar 2004 22:03:09 +0100

On 25.03.2004, at 21:34, mmalcolm crawford wrote:

On Mar 25, 2004, at 11:58 AM, Bjoern Kriews wrote:
On 25.03.2004, at 18:41, mmalcolm crawford wrote:
On Mar 25, 2004, at 2:12 AM, Mike Thorpe wrote:
When it runs I get garbage in the column for non-zero values. It seems as if the NSTableView still thinks it's an NSNumber instead of an NSString.
Do you have a formatter or something else attached to the column?
Malcolm, could you kindly explain if and how one can use formatters
with bindings in place ?

Try it :-)

:-) I did, otherwise I wouldn't have asked - but I managed not to tell the whole story.

It works when you use the "value" binding. I didn't try _that_ before.

If you have dragged a formatter to the field in IB, you can not
bind displayPatternValue1 anymore. Just discovered this.
What I did was _first_ bind displayPatternValue1 and then
add a formatter.
This leads to displayPatternValue1 being listed under "Parameters"
in the binding inspector and not offering the format field anymore.

If you run the app in this constellation, you get:

2004-03-25 21:49:43.076 ButtonMenu[3146] An uncaught exception was raised
2004-03-25 21:49:43.132 ButtonMenu[3146] [<NSTextField 0x331fc0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key displayPatternValue1.
2004-03-25 21:49:43.152 ButtonMenu[3146] *** Uncaught exception: <NSUnknownKeyException> [<NSTextField 0x331fc0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key displayPatternValue1.

So why in heaven does this guy want to use a Formatter _and_ displayPatternValue ?

Because IB has the (known @ Apple) bug that it does not allow you to enter
a small letter 'e' in the formatter inspector (NSNumber, positive value).
And I wanted my TextField to display "Level: 005", so I went for displayPatternValue
and came to the very wrong conclusion that Formatters don't play well with
Bindings.

Thanks for your help, especially the "Try it :-)",
otherwise I would still believe in my misunderstanding.

Regards, Bjoern
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >NSValueTransformer used with table colulms (From: Mike Thorpe <email@hidden>)
 >Re: NSValueTransformer used with table colulms (From: mmalcolm crawford <email@hidden>)
 >Re: NSValueTransformer used with table colulms (From: Bjoern Kriews <email@hidden>)
 >Re: NSValueTransformer used with table colulms (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Return character in NSTableView
  • Next by Date: Re: Vending a proxy problems
  • Previous by thread: Re: NSValueTransformer used with table colulms
  • Next by thread: Re: NSValueTransformer used with table colulms
  • Index(es):
    • Date
    • Thread