Re: How to create an interface without interface builder
Re: How to create an interface without interface builder
- Subject: Re: How to create an interface without interface builder
- From: Michael Mucha <email@hidden>
- Date: Fri, 21 Aug 2009 03:21:45 -0700
I did it without Interface Builder for my first App Store app, over the last
few months. While I found IB interesting, and really slick for certain types
of apps, it didn't seem particularly advantageous for the Core Animation
heavy 2D game I was doing, while I found it annoying that you had to cross
back and forth between IB and hand-coding at a variety of seemingly
arbitrary times. I've only been into Cocoa since December, so I'm sure I'm
doing at least a few, if not most, things wildly wrong, but it worked fine
for me this time. The hardest part was poking thru Google for the few
hand-coding examples buried among all the Interface Builder examples.
However, searching today for "objective-c without interface builder" on
Google seems to turn up quite a few more results than 6 months ago. One
interesting result in googling just now is that Chapter 4 of the 2002
Garfinkel book "Building Cocoa Applications" is devoted to building an app
without IB. Probably a bit dated on the specific API references, though.
That chapter can be found thru Google on books.google.com using the search
term I just mentioned, along with a number of other interesting tip sites.
In a nutshell, I removed the reference to MainWindow.xib from info.plist, to
make a clean break from IB and avoid any unexpected, under the hood
interactions with IB. I manually allocated and init'ed the window in the app
delegate in applicationDidFinishLaunching. I manually allocated and inited a
UINavigationController in the same method, and then added it to the window
as a subview. It took a while to tease out how to get that far, but after I
had a basic view shell, the hard research was done, and most of my learning
after that was more mundane API lookups, without having to wade thru lots of
references to IB. As far as I can tell in my limited experience, everything
you can do in IB, you can do with hand-coding. You probably should be more
careful about writing modular, clean, memory-friendly code when hand-coding,
since IB forces a lot of modularity on you.
_______________________________________________
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