Advertise Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Your First iPhone App
($1.99)

iPhone Code Generator
($9.99)

Calcuccino Programmers' Calculator
($2.99)

DataFon(Build Apps on Windows)
(free)

Infinote Pinboard for Todos and Notes
(free)

picplz
(free)

poG
($2.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-22-2009, 04:37 PM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 49
Default My life got so much easier without the xib. Now, how do I get rid of MainWindow.xib?

When I stoped using the IB and instead coded everything myself everything got so much easier and I could focus on program logic instead of finding out which dot to drag'n drop to which spot.

I'm no trying to reduce all the XIB-files and I have just one left, it's called MainWindow and is loaded from the plist with the plist-property main nib file base name.

What are the necessary steps to have an application completely without nib files?
Joche is offline   Reply With Quote
Old 02-22-2009, 05:48 PM   #2 (permalink)
New Member
 
mcurtis's Avatar
 
Join Date: Oct 2008
Location: St. Louis
Posts: 44
Default

The answer depends on what you have in your MainWindow.xib file. Anything defined there will have to be recreated in your code.

Here are the steps I had to take to go xib-less. They are probably the minimum, since I never used IB on any of my projects.

1. Under the Project menu, choose Edit Active Target "<target name>". Select the Properties tab and blank out the Main Nib File field. Close the Target Info window.

2. Under the Other Sources group and edit the main.m file. In the UIApplicationMain function call, change the last parameter to the name of your application delegate class.
Code:
    int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
3. In your application delegate you need to create a window object. I do this in -applicationDidFinishLaunching:. If you defined anything else in your MainWindow.xib, you can probably create that here, too.
Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
    UIWindow *appWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window = appWindow;
    [appWindow release];
}
4. Delete MainWindow.xib from the Resources group.
__________________
Memos - Easily create, organize & share text documents.

Blue Marble Software
mcurtis is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements
» Stats
Members: 51,374
Threads: 52,830
Posts: 225,477
Top Poster: BrianSlick (3,576)
Welcome to our newest member, bob8caldwell
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:27 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0