Home > Coding > Building an iPhone App Without Interface Builder

Building an iPhone App Without Interface Builder

February 25th, 2009


Building iPhone Applications without Interface Builder from Troy Mcilvena on Vimeo

Adding this one for my own future reference. The important things to note was really how to remove the references to the NIB files when first building the project.

In the Resouces like locate the info.plist file and right click then go to source view and delete:

key - NSMainNibFile
string - MainWindow

While you’re in he resources list also delete the mainWindow.xib file. Finally open “Other Sources” main.m and you’re going to edit this line:

int retVal = UIApplicationMain(argc, argv, nil, nil);

and make it look like this:

    int retVal = UIApplicationMain(argc, argv, nil, @"Your_App_Delegate_Class");

That pretty well sums up the key points. There’s some good information about UIWindow and UIView in the video as well if you’re not familiar with building your base view without IB. gCalWall was built largely without using Interface Builder at all so I was pretty familiar with most of it.

Post to Twitter Tweet This Post

brandon Coding

  1. September 15th, 2009 at 11:47 | #1

    Hello,
    I have a question about building an iPhone app programmatically without using Interface Builder.
    I outsourced a project to have a developer develop an iPhone app.
    I asked that it be built programmatically without using Interface Builder so that I could better see how the coding gets done to create everything.
    The developer sent an initial version of the GUI after a month and a half. It has about a dozen .NIB files – one for each of the screens.
    Doesn’t that mean that he didn’t actually build the screens programmatically? I have yet to open the project on the Mac, so I can probably tell more then how he did things. Note: what he sent isn’t intended to be a prototype, as I gave him the design for the GUI, so no prototype really needed.
    Pretty depressing when I look at what I requested, and see what he sent back, though – I asked for a 747, and got a glider in return I think.

  2. brandon
    September 15th, 2009 at 12:06 | #2

    Without seeing the code it’s really hard to say what was done. There’s an off chance that the NIB files are only there for the purpose of using them to push the view onto the screen and then all the UI elements are still being built in code. But if you were really building the whole app in code you wouldn’t really need the NIB files at all.

    I guess long story short – fire up Xcode and see what’s in the nib files. If all the UI elements are there – then you didn’t get what you asked for. If they’re all just blank windows then whoever built the app was just using them to control the view size and still building all the elements manually.

  3. February 20th, 2010 at 19:58 | #3

    @Gregory Thomson: I do all of my prototyping for clients in IB, just for speed purposes (as in really quick to program, not a speedy app), get the sign off from the client, then do everything programmatically. I would be pretty upset that it took a month and a half though, unless it was an ungodly huge program. It usually takes about 3 days to create an app using IB to demo the UI to the client.

  4. February 21st, 2010 at 08:16 | #4

    This has to be the best tutorial I have seen yet on iphone apps.

    As a veteran emacs gent I want to write code, not play within the confines of someone else’s GUI App. After trying interface builder for a few hours I realized that it just was not a tool for building complex applications, I was further disappointed that I could not find some functionality to export a window as just the raw code it would take to build it locally.

    Not only did you give me a good starting point from an XCode project, but I also saw the basics of allocation,release, and some syntax examples that shed just the right amount of light on the some of the differences between Objective C and the languages I am used to writing in.

    Anyway, you have probably saved me days of reading — trial and error, this will be one of the first tutorials I show new engineers.

    Cheers!

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.