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.
source share