---
title: "bestRepresentationForDevice:"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsimage/bestrepresentationfordevice:"
---

# bestRepresentationForDevice:

Returns the best representation for the device with the specified characteristics.

## Declaration

```occ
- (NSImageRep *) bestRepresentationForDevice:(NSDictionary *) deviceDescription;
```

## Parameters

- `deviceDescription`: A dictionary of attributes for the specified device, or nil to specify the current device. For a list of dictionary keys and values appropriate to display and print devices, see the constants in doc://com.apple.appkit/documentation/AppKit/NSScreen.

## Return Value

Return Value The image representation that most closely matches the specified criteria.

## Discussion

Discussion If deviceDescription is nil, this method uses the attributes of the device on which the content is to be drawn.

## See Also

### Related Documentation

- [isValid](appkit/nsimage/isvalid.md)
- [representations](appkit/nsimage/representations.md)
- [matchesOnMultipleResolution](appkit/nsimage/matchesonmultipleresolution.md)
- [prefersColorMatch](appkit/nsimage/preferscolormatch.md)

### Instance Methods

- [lockFocus()](appkit/nsimage/lockfocus().md)
- [lockFocusFlipped(_:)](appkit/nsimage/lockfocusflipped(_:).md)
- [unlockFocus()](appkit/nsimage/unlockfocus().md)
- [init(iconRef:)](appkit/nsimage/init(iconref:).md)
- [lockFocusOnRepresentation:](appkit/nsimage/lockfocusonrepresentation:.md)
- [compositeToPoint:operation:](appkit/nsimage/compositetopoint:operation:.md)
- [compositeToPoint:fromRect:operation:](appkit/nsimage/compositetopoint:fromrect:operation:.md)
- [compositeToPoint:fromRect:operation:fraction:](appkit/nsimage/compositetopoint:fromrect:operation:fraction:.md)
- [compositeToPoint:operation:fraction:](appkit/nsimage/compositetopoint:operation:fraction:.md)
- [dissolveToPoint:fraction:](appkit/nsimage/dissolvetopoint:fraction:.md)
- [dissolveToPoint:fromRect:fraction:](appkit/nsimage/dissolvetopoint:fromrect:fraction:.md)
- [setScalesWhenResized:](appkit/nsimage/setscaleswhenresized:.md)
- [scalesWhenResized](appkit/nsimage/scaleswhenresized.md)
- [setDataRetained:](appkit/nsimage/setdataretained:.md)
- [isDataRetained](appkit/nsimage/isdataretained.md)
