Feeds

Discover OS X's hidden artistic side

Jobs' past revisited

The Power of One Brief: Top reasons to choose HP BladeSystem

Mac secrets One of the most frequently used Cocoa classes is NSImage which, as the name suggests, is all about displaying and manipulating image data. The imageNamed: method of this class retrieves an image reference for you - provided that you know the name of the image you're after.

Many of the images that can be retrieved via the imageNamed: method have well documented names, but there's a lot of stuff in there that's not well-known. It's those images - including some for Windows - that I'll be digging into here. I shall also give you source code to a little utility that uses an entirely different mechanism to retrieve images used by OS X.

Old NeXT image

Dig into the past with AppKit

Internally, AppKit maintains an extensive list of small bitmaps that are referred to as the built-in icon list. When you call the imageNamed: method, this is one of many places that gets searched for an image of that name. You shouldn't confuse this with documented system image names such as NSImageNameIconViewTemplate, NSImageNameRefreshTemplate, and so on.

In general, the documented images are high-quality scalable images while the built-in icon list contains non-resizable bitmaps, which only look good - well, some do - at their default size.

NeXT step

Before we go any further let's take a trip down memory lane. Fire up our old friend Interface Builder, drop a NSImageView control onto a window and set the image name to NXdefaulticon. Note: capitalization is important.

You should be rewarded with a blast from the past: the old NeXT icon. NeXT, was of course, the company created in 1985 by Apple chief executive Steve Jobs during his brief Apple hiatus. Apple went on to buy NeXT and incorporated much of its programming framework into OS X.

Interestingly, AppKit contains a lot of these historical relics, including NXdefaultappicon, NXHelpBacktrack, and a great deal more. I imagine that a lot of these image names were originally supported to aid in porting existing NeXTSTEP applications across to OS X while the latter was under development.

In addition to a wide variety of NeXT icons, you'll also find a full complement of - horror of horrors! - Windows bitmaps. It's enough to make any self-respecting Mac developer cringe but - yes - they're there!

Securing Web Applications Made Simple and Scalable

Next page: Heads-up

More from The Register

next story
Apple fanbois SCREAM as update BRICKS their Macbook Airs
Ragegasm spills over as firmware upgrade kills machines
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Captain Kirk sets phaser to SLAUGHTER after trying new Facebook app
William Shatner less-than-impressed by Zuck's celebrity-only app
Microsoft takes on Chromebook with low-cost Windows laptops
Redmond's chief salesman: We're taking 'hard' decisions
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
EU dons gloves, pokes Google's deals with Android mobe makers
El Reg cops a squint at investigatory letters
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Reducing security risks from open source software
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Consolidation: the foundation for IT and business transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.