Does this Mac use the metric system? 1

I’m writing a small application that interacts with iWork templates. Now iWork has two sets of templates; a “Traditional” set using the Imperial measurement system (inches, US Letter page size, etc), and an ISO set for the Metric measurement system (centimetres, A4 page size, etc).

The issue I faced was which templates to interact with. An American user would want to learn about the Traditional set, but an Australian or European user would want to find out about the ISO set.

Unfortunately, the Cocoa API doesn’t include a method for determining what measurement system is in use. But a quick search on CocoaDev reveals that Carbon does:

Boolean IsMetric ();

Cocoa developers just need to import the Carbon framework into the relevant .h file and IsMetric() away!

Advertisements

No comments yet

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: