Cocoa Documentation on NSFormatter
Cocoa Documentation on NSFormatter
- Subject: Cocoa Documentation on NSFormatter
- From: Thomas Lachand-Robert <email@hidden>
- Date: Sat, 15 Dec 2001 14:44:07 +0100
I believe that the formatters are actually a great feature of Cocoa, but
they are made difficult to use by the confuse documentation of NSFormatter
(and TasksAndConcepts-ProgrammingTopics-DataFormatting too). You need to
explain not only what each method do, but also they articulate together.
That is: what happens exactly when the user types in or validate a
textfield with a formatter?
Also I discovered today that the "obj" item returned by
getObjectValue:(id *)obj forString:(NSString *)exprstr
errorDescription:(NSString **)error
is supposed to conform to NSCopying, since I got
*** -[myObjectClass copyWithZone:]: selector not recognized
Then, the correct declaration should be
getObjectValue:(id<NSCopying>*)obj forString:...
or even more likely should be
getObjectValue:(NSObject*<NSCopying>*)obj forString:...
because probably it is assumed that obj is a NSObject as well.
This sort of mistake makes very difficult to implement a custom formatter,
even after reading the Vermont Recipe 5.
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.