Re: Creating More Than 1 Of The Same Element/control
Re: Creating More Than 1 Of The Same Element/control
- Subject: Re: Creating More Than 1 Of The Same Element/control
- From: Robert Vojta <email@hidden>
- Date: Thu, 23 May 2013 08:19:25 +0200
On Thursday, 23. May 2013 at 2:03, Thomas Davie wrote:
> I'd really very strongly suggest that you just use Interface Builder. Your user interface is essentially data, not code. I doubt (and hope) very much that you don't write code to fill up a buffer with image data at runtime, rather than storing images in data files. The same logic applies to your UI – store your archived objects in a nib file, and use IB to edit them.
I'd very strongly argue with this statement … Personally, I do use IB just for common things like preferences window with standard controls, etc. I do use it rarely for other windows, views, … and if then just with custom NSView as a placeholder for things I do want to create in code. It's not that IB is horrible, but it's about personal taste, development speed and lot of other things. For example - try to precisely edit auto layout constraints in IB. Sorry, but this is nightmare - mouse heavily involved, … I'm much faster with my macros like …
TM_NSLC_BINDINGS( _warningLabel, _closeButton );
if ( _sticky ) {
TM_ADD_NSLC_VISUAL( @"H:|-16-[_warningLabel]-10-[_closeButton(8)]-16-|" );
TM_ADD_NSLC_VCENTER_RELATIVE_TO( self.closeButton, self );
TM_ADD_NSLC_VISUAL( @"V:[_closeButton(9)]" );
} else {
TM_ADD_NSLC_VISUAL( @"H:|-10-[_warningLabel]-10-|" );
}
TM_ADD_NSLC_VISUAL( @"V:|-16-[_warningLabel]-16-|" );
… than with mouse & IB. And many more examples.
In other words, Interface Builder is not a must, not a dogma, it's just about each developer's taste what's better to use. Stick with whatever you do want and what's better for you. Both worlds have +- and the best thing you can do is to combine them.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden