Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6768173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:02:38+00:00 2026-05-26T15:02:38+00:00

I am reading Programming iOS4 by O’Rielly and I am using a slightly newer

  • 0

I am reading Programming iOS4 by O’Rielly and I am using a slightly newer version of XCode than the one that the book is using. However, this slight change has led to a little bit of confusion because I cannot create window-based app using the XCode 4.2.

Anyhow, I started an empty project which gave me the barebone structure for an iPhone app without the MainWindow.xib. I was already given the project’s delegate .h and .m. I proceeded to create my own MainWindow.xib. I figured out that I had to set ‘Main nib file base name’ to ‘MainWindow’ for my nib to show up at all and so I did that.

Inside my MainWindow.xib, I added a button under the window object just to make sure that I have what I want when I run the project. This is the state of my nib right now

MainWindow.xib

Without making any changes to the AppDelegate.h and AppDelegate.m, I built and ran my project. I was able to see the button! HOWEVER, I could not click on the button and when I pressed the home button and resumed my empty app, I could not see the button anymore! Here are some files that I did not make any changes to:

main.m

#import <UIKit/UIKit.h>

#import "EmptyWindowAppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([EmptyWindowAppDelegate class]));
    }
}

EmptyWindowAppDelegate.m

#import "EmptyWindowAppDelegate.h"

@implementation EmptyWindowAppDelegate

@synthesize window = _window;
@synthesize managedObjectContext = __managedObjectContext;
@synthesize managedObjectModel = __managedObjectModel;
@synthesize persistentStoreCoordinator = __persistentStoreCoordinator;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}
//...Omitted
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:02:39+00:00Added an answer on May 26, 2026 at 3:02 pm

    You can specify the name of the main nib file in your application plist (by default it is MainWindow.xib).

    To investigate your problem further you could just create a default view based app and see what the differences are. It seems to me that you have made no connection in interface builder between your App Delegate’s window property and your IB window object. Which means that window, in didFinishLaunchingWithOptions would probably be nil and that the messages you send it will therefore have no effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading Programming Clojure and I'm interested in a book that discusses how to
I am reading about programming, and one exercise involved programming Pascal's triangle in R.
I have just been getting into low level programming (reading/writing to memory that sort
I'm reading The C++ Programming Language and in it Stroustrup states that the int
I'm reading The C++ Programming Language. In it Stroustrup states that sizeof(char) == 1
I'm reading about functional programming and I've noticed that Pattern Matching is mentioned in
I am reading Java Thread Programming a book by Paul Hyde .I am into
I've been reading Programming WPF, here is one of the examples about Control Template:
I'm reading programming best practices and it is said that when creating a function
I'm reading the Programming in Scala book by the Scala Creator and I'm a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.