O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSView — Mac OS X 10.0

Synopsis

This is the Cocoa interface to Mac OS X’s graphics APIs, including Quartz 2D, OpenGL (using NSOpenGLView), and QuickDraw (using NSQuickDrawView). Anything that is drawn to screen in Cocoa is done so within a view object. Developers can implement custom drawing behavior by subclassing NSView and overriding the drawRect: method. See Chapter 3 for more information on how views relate to other classes in the AppKit.

image with no caption

@interface NSView : NSResponder
                                  // Initializers
   - (id)initWithFrame:(NSRect)frameRect;
                                  // Accessor Methods
   - (void)setBoundsSize:(NSSize)newSize;
   - (void)setFrameOrigin:(NSPoint)newOrigin;
   - (void)setFrame:(NSRect)frameRect;
   - (NSRect)frame;
   - (void)setAutoresizingMask:(unsigned int)mask;
   - (unsigned int)autoresizingMask;
   - (void)setUpGState;
   - (void)setBoundsRotation:(float)angle;
   - (float)boundsRotation;
   - (void)setAutoresizesSubviews:(BOOL)flag;
   - (BOOL)autoresizesSubviews;
   - (void)setNeedsDisplayInRect:(NSRect)invalidRect;
   - (void)setBoundsOrigin:(NSPoint)newOrigin;
   - (void)setFrameRotation:(float)angle;
   - (float)frameRotation;
   - (void)setNeedsDisplay:(BOOL)flag;
   - (BOOL)needsDisplay;
   - (void)setToolTip:(NSString *)string;
   - (NSString *)toolTip;
   - (void)setFrameSize:(NSSize)newSize;
   - (void)setBounds:(NSRect)aRect;
   - (NSRect)bounds;
   - (void)setPostsFrameChangedNotifications:(BOOL) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required