With Leopard coming up, every Cocoa and Carbon developer will need to check their drawing to make sure they’re drawing in a resolution-independent way. Most people will go about doing this by going to Quartz Debug, open its User Interface Resolution panel, changing the DPI setting and then launching their application. And changing the DPI setting back when they’re done, of course.
Luckily, Xcode is flexible enough to provide a better way.
- Locate your app’s Executable in the Groups and Files table. (Not the .app bundle or the binary under the Products group, the “Executable” under the special pen-and-paper-icon Executables group.)
- RIght-click it and choose Duplicate. (You may want to rename the new Executable.)
- Double click the new Executable to bring up its Info panel.
- Go to the Arguments tab.
- Add a new entry with the following argument:
-AppleDisplayScaleFactor 2.0. (You can of course change 2.0 to taste.) The panel will look something like this when you’re done:
- To try your app out in the scaled resolution, just change the “Active Executable” in the toolbar or by using the menus: Project → Set Active Executable, and then Run (or Debug) the app as usual.
You may also wish to read more on resolution independence itself:
- Daniel Jalkut explains how to draw images ‘live’ and thusly in the native resolution using everyone’s favorite class,
NSCustomImageRep, and everyone’s favorite little yellow guy. - The (luckily) inimitable Peter Hosey explains how to set up file build rules to compile EPS files to PDF files at build time. Incredibly useful for the other four of you who write your own PostScript.
- Apple’s own Resolution Independence release notes provides the state of the union of Tiger-level resolution independence, with some notes about Tiger hiding its support because no UI work of either exposing the slider nor creating a resolution independent UI had been made. Note that Leopard will ship with a totally resolution independent UI, and you’d better want to fit in here.
Happy hacking.