Do not fear the NIB!

In all of my Cocoa adventures to date, the creation of graphical user interfaces (GUIs) using Interface Builder has been both the best part of the experience and the worst. Coming from a java background I had previously hand coded all of my GUIs, and in the process have gained a valuable insight into the dreaded GridBagLayout manager (yes I am aware of the various java GUI designers, but I have never found one that I like using).

In the early days it was fantastic to create a native GUI with ease pushing the components around, conforming to Apple’s human interface guidelines was a mere snap away. I was blown away, I was able to take charge of tables like never before! But as I began to understand a little more Cocoa and move away from the tutorials I got a little lost. Where do I put this object? Should I instantiate it in the NIB or from the code? I did (and *occasionally* still do) miss connections, and then wonder why things aren’t happening.

However recently I’ve noticed that I am getting better at understanding where to instantiate objects, and how to link code to NIB files and so on. In the event of any unexpected behaviour, a systematic approach seems to solve most bugs and I can finally spot missing actions. It may take time, and even a little patience, but as you travel on your quest for more cocoa knowledge do not fear the NIB!

Comments are closed.