PDA

View Full Version : View code of existing preference pane.




Submerged06
May 28, 2012, 04:42 PM
Hello,

I'm a long-time web programmer, but I have no experience with Mac programming. However, I have a preference pane application that I'd like to see the source code of (just out of curiosity / to see a working example of code).

I have xcode 4, and I know how to open the package and locate the executable under "MacOS" -- but when I open it in xcode, it just shows a picture of the black box with a green 'exec' in the upper-left corner.

I don't need to copy, edit or compile the code, I'm just curious about it what it might look like :). I suppose it might just not be possible, which is lame but fair enough. Haha.

Anyhow, any help would be great. This seems like a basic question, but I couldn't find anything on Google over an hour or two of searching.

- Alex



ArtOfWarfare
May 28, 2012, 07:06 PM
I don't have any experience with programming preference panes, but my guess would be that the source code used to create them would be compiled so you wouldn't be able to look at the source code without contacting the author and asking for it.

The one thing you might be able to do is find a nib or xib in a resources file... if their interface was set up in there and they relied on cocoa bindings, you might be able to open that and do some tweaks, but I wouldn't really expect you to be able to do much.

Submerged06
May 28, 2012, 07:13 PM
Ah, thanks for the information. There's a nib, but not much there to look at (just a list of random values and whatnot). I'll just look up some example code on Google and wet my interest a bit :). Thanks!

Red Menace
May 28, 2012, 08:51 PM
The executable code is, well, the code that is directly executable by the processor, and is created by a compiler (http://en.wikipedia.org/wiki/Compiler) - it isn't a scripting/markup language or configuration file that is human readable (well, not readable by most, anyway). You aren't going to get much out of a nib file either since most are compiled these days, but they are just files that describe various parts of the user interface. If the prefpane project source files are not available, you can check out Apple's documentation (https://developer.apple.com/library/mac/#documentation/userexperience/Conceptual/PreferencePanes/Tasks/Creation.html) and example project (https://developer.apple.com/library/mac/#samplecode/PrefsPane/Introduction/Intro.html), or look at an open source project such as Perian (http://perian.org/).