

Convert NIB Files to Objective-C Code - oscardelben
https://github.com/akosma/nib2objc

======
panic
Why would you want to do that?

~~~
edge17
because some people don't like having boxes in the middle that they can't look
inside of. I started hacking iphone stuff before there was an sdk, and as a
result every time I start a new ios project I rip out all the interface
builder stuff... the whole thing just doesn't make sense to me.

I'm sure it's a great tool though, clearly with so many apps out there, people
are using it.

~~~
Zev
As little as I like IB, it being a black box is not one of my complaints. A
xib is just an xml file. You can open it up in a text editor and see what
happened. You can copy the xib, set an option and diff the two files and
clearly see what it did. Dragging lines around is just a different way of
setting a target/action pair. Dragging views just sets the frame for you
rather than you setting it, etc etc.

Now, if you wanted to argue that IB is bad because XIBs don't merge easily, I
might agree with you[1]. Or even that nib loading is slow iOS 3.x[2]. It does
make it slightly harder to use custom views, I suppose. But, _a lot_ of the
views I make are just existing views combined, not so much custom drawing[3].
And IB excels at that.

1\. I'd actually say this is a failing of almost every VCS out there because
it doesn't let you lock files. CVS is the only VCS that I know of that lets
you do this.

// edit: As masklinn and shaggyfrog point out below, this isn't quite true.
Centralized vcs's let you lock files, dvcs's don't. The point is that merge
conflicts suck — and with xibs, can't be fixed..

2\. UINib on iOS 4 makes nib loading much faster and much less of an issue.

3\. Unless I need it to be very, very, very fast. But, I try to avoid this as
it makes it harder to change the look around a month from now.

~~~
shaggyfrog
"I'd actually say this is a failing of almost every VCS out there because it
doesn't let you lock files. CVS is the only VCS that I know of that lets you
do this."

I know that both Perforce and Subversion allow file locking.

~~~
timrobinson
And ClearCase and Visual Source Safe.

File locking is typically popular in version control systems that have limited
merge abilities. Perforce is a little better at resolving merge conflicts than
the others mentioned here; locking tends to be limited to files that can't be
merged, such as binaries.

------
headhuntermdk
Using this tool, how would a developer properly support localization?

if (english) { // 100 LOC } else if (german ) { // 100 LOC } else if (french)
{ // 100 LOC }

seriously? Might as well use the tools that Apple supports/uses instead of
spending time and energy reinventing the wheel

~~~
Hagelin
NSLocalizedString ?

~~~
rufo
You often have to rearrange your UI due to varying lengths of words/phrases
across languages, so just swapping out strings isn't enough.

