NSFormatter in Cocoa-Java
NSFormatter in Cocoa-Java
- Subject: NSFormatter in Cocoa-Java
- From: Enrico Stamigna <email@hidden>
- Date: Mon, 26 Nov 2001 17:54:25 +0100
Hi,
I have written, using Java, two very simple NSFormatter subclasses, in
which I have implemented the following methods:
public String stringForObjectValue(Object anObject)
public NSAttributedString attributedStringForObjectValue(Object
anObject, NSDictionary attributes)
public Object objectValueForString(String aString)
When I modify the content of a NSTextField that use an instance of my
subclasses, I always get this error:
-getObjectValue:forString:errorDescription: only defined for
abstract class. Define -[StringFormatter
getObjectValue:forString:errorDescription:]!
My implementation comply with the API and the documentation:
from "Creating A Custom Formatter"
"To subclass NSFormatter, you must, at the least, override the
three primitive methods ... objectValueForString (called
getObjectValue:forString:errorDescription: in Objective-C), ..."
Can someone of you see my mistake?
Thank you.
Enrico Stamigna