Name

NSCell — Mac OS X 10.0

Synopsis

This class is the base superclass for the hierarchy of lightweight objects that know how to draw into a view. Most NSControl classes in the Application Kit defer the implementation of drawing to an associated NSCell. For example, NSButton uses a concrete subclass of NSCell, NSButtonCell, to handle all of the drawing and event handling of a button interface component. Cells provide a leaner alternative to using views in situations when a control appears repeatedly in a view. The interface of NSCell is closely mirrored in NSControl; indeed, many concrete subclasses of NSControl forward most messages to their associated NSCell object.

image with no caption

@interface NSCell : NSObject <NSCoding, NSCopying>
                                  // Initializers
   - (id)initImageCell:(NSImage *)image;
   - (id)initTextCell:(NSString *)aString;
                                  // Accessor Methods
   - (void)setBezeled:(BOOL)flag;
   - (void)setType:(NSCellType)aType;
   - (NSCellType)type;
   - (void)setCellAttribute:(NSCellAttribute)aParameter 
                                 to:(int)value;
   - (void)setAllowsMixedState:(BOOL)flag;
   - (BOOL)allowsMixedState;
   - (void)setTarget:(id)anObject;
   - (id)target;
   - (void)setAction:(SEL)aSelector;
   - (SEL)action;
   - (void)setImportsGraphics:(BOOL)flag;
   - (BOOL)importsGraphics;
   - (void)setTag:(int)anInt;
   - (int)tag;
   - (void)setTitle:(NSString*)aString;
   - (NSString*)title;
   - (void)setAllowsEditingTextAttributes

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.