I would like to write a script (or locate one if it’s been done already) that will return every named object of every nib in an Xcode project. I want to be able to get, at the very least, the name of each object and the type of each object (i.e.: button, text field, window, etc.)
Currently, after I’ve created an interface, I will write down all this information. I’ll then key this information at the top of each script file in my project. It is a very handy reference, especially in larger project with many windows, panels and controls.
I’m sure this information can be obtained, I’ve just not been able to figure out how to get to it. This is a tool that I will definitely make available to everybody.
Thanks in advance,
Brad Bumgarner, CTA
a really (I mean REALLY) raw form of info would be:
nibtool -a /path/to/Some.nib
You can get what you asked for… plus a whole lot more than you wanted! nibtool is some part of the Xcode install, so it wouldn’t be a general purpose solution.
Thanks for the info. It does, indeed, return a lot of info. However, I think I should be able to parse out the info that I want.
Thanks again,
Brad Bumgarner, CTA
Unfortunately, after sifting through all the data returned, I can not find a way to get all the info I need. Example: NSTextField objects that are editable seem to have generic names. There are a number of ASKNibObjectInfo objects that have the text field names. I can’t find a way to link the two together. I guess I’ll just have to keep searching.
Brad Bumgarner, CTA
Yeah, so I see. There aren’t a whole lot of other nib tools out there - in fact I don’t think there any alternatives.
Looking at a keyedobjects.nib in a hex editor, nothing jumps right out. The first few characters are “bplist” which would seem to mean that it was an binary xml file - except plutil (to be only used on a copy) didn’t quite work magic on it - at least I didn’t think so.
Possibly hex “D2 00 47 00” denotes a new object… not too sure.
It would seem that hex “D5 0A 58 0A 59 0A 5A 00 16 0A 5B” is quite popular too - just don’t know what it means. It occurs in both buttons & NSTextFields, so it either represents the "class = ‘ASKNibObjectInfo’ thing, or it represents ‘application.applescript’.
nibtool isn’t opensourced either - at least I couldn’t find it in darwinsource.
Doesn’t look like an easy task. Good luck with it though.
Xcode and IB can keep track of everything, so I know there’s a way. I just don’t know what it is yet!