by drpancake · 15y ago · 0 comments
You're welcome to do it all in code, but it seems to be discouraged by many.
Now in the nib you say "here are three buttons, connect them to outlets a, b, c." Now when Someone asks the controller for it's view it will create the views and connect the pointers in the manner you requested.
There is "magic" taking place, but no more so than the interaction between HTML and JavaScript in a web page. It may be unfamiliar at first, but not unfathomable.
It's certainly magical in the sense that it's a beautiful way to do things. ;-)
I think simple programs should be able to be expressed in one file and created in a simple text editor.
I have no trouble with thinking about objects in memory that I create through code. But when I look at a XIB, it has things in it like "File's Owner" and "First Responder" and "Application" that I'm not sure what they do. And when interfacing with a XIB, I'm not ever sure if that thing I'm looking at is instantiated in the XIB, or if I have to make it myself, and so on.
I suppose I could have gotten over those mental hurdles eventually, but I chose not to. I prefer thinking about objects that I make myself, and I avoid Interface Builder whenever possible.