Inherits From: NSObject
Conforms To: NSObject (NSObject)
Declared In: AppKit/NSScreen.h
An NSScreen object describes the attributes of a computer's monitor, or screen. An application may use an NSScreen object to retrieve information about a screen and use this information to decide what to display upon that screen. For example, an application may use the deepestScreen method to find out which of the available screens can best represent color and then may choose to display all of its windows on that screen.
The two main attributes of a screen are its depth and its dimensions. The depth method describes the screen depth (such as two-bit, eight-bit, or twelve-bit) and tells you if the screen can display color. The frame method gives the screen's dimensions and location as an NSRect.
The device description dictionary contains more complete information about the screen. Use NSScreen's deviceDescription method to access the dictionary, and use these keys to retrieve information about a screen:
Dictionary Key Returns
NSDeviceResolution An NSValue describing the screen's resolution in dots per inch (dpi).
NSDeviceColorSpaceName The screen's color space name. See NSGraphics.h for a list of possible values.
NSDeviceBitsPerSample The bit depth of screen images (2-bit, 8-bit, etc.).
NSDeviceIsScreen YES, indicating the device is a screen.
NSDeviceSize An NSValue describing the screen's size in points.
The device description dictionary contains information about not only screens, but all other system devices such as printers and windows. There are other keys into the dictionary that you would use to obtain information about these other devices. For a complete list of device dictionary keys, see NSGraphics.h.
Creating NSScreen Instances