Why does the Builder interface feel like it's just bothering me?

I am very new to Cocoa for MacOSX, but I can't help but feel like I'm constantly struggling with Interface Builder.

My current situation is that I am creating an application that will have several custom controls and views. I started creating the application in the Builder interface, because it was very easy to drag things from the beginning and get them to the right places with the right colors and the right autosave rules. However, the time has come to start creating my own user controls and views, which I cannot imagine perfectly in Interface Builder without going through the IBPlugin creation job! The only other option that I know of is to have an Interface Builder document that includes a bunch of "custom views" everywhere, only with a change in their class. Suddenly, it seems pointless to even worry about IB - especially in light of the fact that these controls and views will have properties such as the color to be set - like other views and controls already in the IB document. So now I have visualization properties that are set in two disconnected places and seem to counter one of IB's potential advantages, which makes it relatively easy to customize the user interface of the application without digging into the code.

I also encounter a situation where several controls change properties (e.g. colors) based on data or current selections. So now I have the default initial colors for the control specified in Interface Builder, but should I specify the colors controlled by the data in the code? As soon as the Builder interface seemed to make me break some presentation parameters between it and the code. I believe this can be resolved with a sophisticated plugin that knows about my data or states or something else, but it looks like I would end up supporting a ton of support code that exists in such a way that the Interface Builder experience remains " right. "

Something else that I often mentioned is how easily IB allows you to define bindings between components. "You can do this without writing any code!" Again, I can miss something, but binding one property to another is one line of code, as far as I can tell. Is setting a pair of properties in a box in IB really better than writing a single line of code? And why is it better to indicate what constitutes application logic in the presentation layer specification?

As I said, I'm pretty new to this Cocoa stuff, but I feel like I am missing something very important in how to use Interface Builder, or it is primarily intended for trivial demos with a high wow factor.

+4
source share
4 answers

I find that Interface Builder is great for getting a general layout of the application. This is also great for things like bindings (on Mac). However, you are not going to create a Delicious Library using Interface Builder. The more complex your interface, the more code you will have to write.

+7
source

The Builder interface may be a bit used. But, as mentioned earlier, the more you use it, the better. Of course, custom views can be made in code, but IB is the standard for a reason. Mac applications adhere to certain community user interface quality standards that are much higher than user interface standards for other platforms. IB greatly simplifies compliance with these standards than the execution of all code without a visual link.

And you do not need to do everything in code to have your own version control interface. All my Cocoa projects live in their own git repository, including nib / xib files.

So give IB a chance. It gets easier the more you use it.

+6
source

Jeff LaMarche (from the history of the iPhone) wrote an excellent article about why IB is a good choice to use, even if it doesn’t seem “the right way” as soon as you go through the basic tutorials. I gave up IB for similar reasons, but the article inspired me to continue to work with him, and in fact this is indeed the right decision, although it contradicts geek’s desire to avoid too missed abstractions.

+2
source

My first iPhone program, available for sale, and my second one in development, do not use Interface Builder. I like to have all of this in code so that I can understand what is happening and so that I can use version tracking to track all changes.

As far as I know, it depends on preference. There are Cocoa books that use both styles (IB and IB).

+1
source

All Articles