A method identified as deprecated has been superseded and may become unsupported in the future.
Returns the type of data the user can type into the receiver. (Deprecated in Mac OS X v10.0 and later. Use a formatter instead—see setFormatter:.)
- (NSInteger)entryType
One of the types listed for this method in “Data Entry Types”. If the receiver is not a text-type cell, or if no type has been set, NSAnyType is returned.
NSCell.hSets how numeric data is formatted in the receiver and places restrictions on acceptable input. (Deprecated in Mac OS X v10.0 and later. Use a formatter instead—see setFormatter:.)
- (void)setEntryType:(NSInteger)aType
One of the types listed for this method in “Data Entry Types”.
The formatter associated with the receiver is replaced with a newly instantiated formatter appropriate to the entry type.
If the receiver isn’t a text-type cell, this method converts it to one; in the process, it changes its title to “Cell” and sets its font to the user’s system font at 12 points.
You can check whether formatted strings conform to the entry types of cells with the isEntryAcceptable: method. NSControl subclasses also use isEntryAcceptable: to validate what users have typed in editable cells. You can control the format of values accepted and displayed in cells by creating a custom subclass of NSFormatter and associating an instance of that class with cells (through setFormatter:). In custom NSCell subclasses, you can also override isEntryAcceptable: to check for the validity of data entered into cells.
NSCell.hSets the autoranging and floating point number format of the receiver’s cell. (Deprecated in Mac OS X v10.0. Use a formatter instead. See setFormatter:)
- (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits
If YES, autoranging is enabled, otherwise it is disabled.
The number of digits to display to the left of the decimal point.
The number of digits to display to the right of the decimal point.
Sets whether floating-point numbers are autoranged in the receiver and sets the sizes of the fields to the left and right of the decimal point. If autoRange is NO, leftDigits specifies the maximum number of digits to the left of the decimal point, and rightDigits specifies the number of digits to the right (the fractional digit places will be padded with zeros to fill this width). However, if a number is too large to fit its integer part in leftDigits digits, as many places as are needed on the left are effectively removed from rightDigits when the number is displayed.
If autoRange is YES, leftDigits and rightDigits are simply added to form a maximum total field width for the receiver (plus 1 for the decimal point). The fractional part will be padded with zeros on the right to fill this width, or truncated as much as possible (up to removing the decimal point and displaying the number as an integer). The integer portion of a number is never truncated—that is, it is displayed in full no matter what the field width limit is.
The following example sets a cell used to display dollar amounts up to 99,999.99:
[[currencyDollarsField cell] setEntryType:NSFloatType]; |
[[currencyDollarsField cell] setFloatingPointFormat:NO left:5 right:2]; |
NSCell.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-10-01)