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 6070313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:55:08+00:00 2026-05-23T09:55:08+00:00

Am trying to connect the App Delegate to the View Controller in Xcode4, but

  • 0

Am trying to connect the App Delegate to the View Controller in Xcode4, but I can’t make the connection for some reason because App Delegate can’t see it in the visual object editor.

Have added the view controller in the visual object editor, and changed the class ID to HelloWorldViewController, and have added the code in the App Delegate.h and .m files.

What am I doing wrong?

Here is the code:

testWindowBasedAppDelegate.h

// -- Add a forward reference to the HelloWorldViewController class --
@class HelloWorldViewController;

#import <UIKit/UIKit.h>

@interface testWindowBasedAppAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    //-- create an instance of the view controller --
    HelloWorldViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;

// -- expose the view controller as a property --
@property (nonatomic, retain) HelloWorldViewController *viewController; 

@end

testWindowBasedAppDelegate.m

#import "testWindowBasedAppAppDelegate.h"
#import "HelloWorldViewController.h"

@implementation testWindowBasedAppAppDelegate


@synthesize window;
//-- synthesize the property--
@synthesize viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    //-- add the new view to the current window --
    [window addSubview:viewController.view];
    [self.window makeKeyAndVisible];
    return YES;
}

- (void)dealloc
{
    [viewController release];
    [window release];
    [super dealloc];
}

@end
  • 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-23T09:55:09+00:00Added an answer on May 23, 2026 at 9:55 am

    You need to add an IBOutlet tag for IB to see it. Declare the property as,

    @property (nonatomic, retain) IBOutlet HelloWorldViewController *viewController;
    

    This even applies for methods that you want to expose but there you will use IBAction instead. For example,

    - (IBAction)doSomething;
    

    Both of these tags are just indicators and are actually declared as,

    #define IBAction void
    #define IBOutlet
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect two of the same app with winsock, but the
I am trying to implement UISearch bar but I have some problems. When app
I'm trying to connect to the Twitter API via an AS3 app, but I
I'm trying to make a C#.net app connect to a server using the XMLSocket
I'm trying to connect to facebook from my iOS application, so I can make
While trying to connect to a database that's set to read only, the connection
I am trying to make Twitter work in my app and everything works fine
I am trying to connect a Rails app on a Windows machine to SQL
I am trying to build a Connect app using PHP and the Zend Framework.
I'm trying to get a VB.net (express 2010) app to connect to a socket

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.