I know you can get the current machine's icon from cocoa using the following code:
NSImage *machineIcon = [NSImage imageNamed:NSImageNameComputer];
But is it possible to get the icon when given just a model number? Such as MacBookPro11,3
?
The reason I need this is because I'm using MultiPeer Connectivity
to browse devices on the network that I'd like to connect to. But I want to display the icons from those devices in a customized browser view.
I know that OS X has pretty much every icon for all the devices in the following folder:
/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/
but I want to know how to get access to them from within my app:
I thought about using the discoveryInfo
from MCNearbyServiceAdvertiser
to transmit an icon of the device advertising, but you can't transmit that much data using discoveryInfo
. It's designed only for small amounts of text. So I've decided to just transmit the machine's model number instead. I'm hoping to resolve the machine's model number to an icon on the other side. Kind of like how AirDrop
does it.