* Posts by Jeff Barbose

2 publicly visible posts • joined 13 Mar 2008

A better way to build OS X preferences

Jeff Barbose

Listening to Mr. Randolph

Dave,

YOU should be listening to John Randolph. I wish there were a hundred John Randolphs out there to help people with Cocoa and Objective C.

There are reasons why private APIs are still private: they're NOT READY FOR PRIME TIME. Unless, of course, you want shitty, substandard APIs releases, then repaired, then required to be dragged along into the future for 5 or 10 years?

Do you know what Image Kit is? Does it look a little familiar? Guess what its history was.

Apple can release a fix to NSPreferences ALONG WITH a new relelase of Mail.app.

If you've never developed APIs for mass consumption, you can be the best engineer in the world and still not understand the caution that must be employed before releasing them.

if you really knew what you were doing with private APIs, employing them should also come with big orange traffic cones around them in your code.

You DO know about dynamic runtimes, right? If you do, you should know how to implement those "orange cones" around calls to undocumented APIs. How come you didn't mention that safeguard?

And why would you go digging in private APIs for this when all you need is an NSToolbar and an NSTabView? You could do far more of it in IB (always better if you can do things there) and avoid being broken in the future?

In my opinion, NO ONE new to Cocoa should be taking advice from this column. Using private APIs is dangerous, stupid and destined to make Mac software overall less stable and less "like a Mac".

Jeff Barbose

2 Bonehead moves in 1!

So you're going to use undocumented APIs--which means they are APIs that aren't ready for prime time--and accomplish two bonehead moves in one fell swoop:

1. You don't even get notifications if these things change, introducing the possibility of subtle bugs in any app in which you use them, effectively creating an app that no one in their right minds would consider using if the app stores or creates valuable user data.

and the big one:

3. You write a help column and suggest that people consider going waaaay off Interface Guidelines in making an app's preferences look like the System Preferences.

(yeah, sure it's just an example, but if this code was really useful, you'd have a useful example.)

Good job you.

Homework for Dave Jewell: find a use for NSPreferences in any place where it wouldn't violate HIG.