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

  • Home
  • SEARCH
  • 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 9303337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:27:43+00:00 2026-06-18T23:27:43+00:00

In my AppDelegate method applicationDidFinishLaunching: // Initialize here NSLog(@Application finished launching…); MyMain* mainAccess; //

  • 0

In my AppDelegate method applicationDidFinishLaunching:

// Initialize here
NSLog(@"Application finished launching...");

MyMain* mainAccess;                    // To send messages to SAAMain
mainAccess = [[Main alloc] init];

NSLog(@"Setting title...");
version = @"v1.0";
[mainAccess setTitleVersion:version];   // Set Title with proper version

As you can see, I created an instance of my MyMain class in order to send a message to it (where all my important “main” methods are located). In this case, I’m trying to set the title.

My MyMain class has a method setTitleVersion and takes a NSString as a parameter (version).

NSLog(@"setTitleVersion called");

NSString *title = [NSString stringWithFormat:(@"Version: %@", version)];
//[_mainWindow setTitle:([NSString stringWithFormat:title])];
[_mainWindow setTitle:@"Test"];

NSString *mainWindowTitle = _mainWindow.title;
NSString *test2 = _mainWindow.value;
NSLog(@"_mainWindow.title: %@\n_mainWindow.value: %@", mainWindowTitle, test2);

I have an outlet of the main window attached to this MyMain class (as you can see with _mainWindow).

I added some NSLogs to try to debug myself. Both the value and title come back as null.

What am I doing wrong? The method is getting called as I can see in the console output. It’s as if the _mainWindow outlet isn’t working properly.

  • 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-06-18T23:27:44+00:00Added an answer on June 18, 2026 at 11:27 pm

    Suppose your child has a bowl of ice cream, and wants a cherry on top. You go to the freezer and get out the ice cream carton. You get a bowl out of the cabinet. You put some ice cream in the bowl. Now you have a bowl of ice cream. You get a cherry out of the refrigerator and put a cherry on it. Then you throw the bowl of ice cream (with cherry on top) away. Now you’re confused, because your child’s bowl of ice cream still has no cherry on top! What did you do wrong?

    This scenario is a metaphor for your problem. You need to send the setTitleVersion: message to your existing instance of MyMain. You can’t just create an entirely new instance of MyMain, send the message to it, and then throw away that new instance.

    Your comment on rdelmar‘s answer says that your existing instance of MyMain is in your main nib, and you have an outlet to it. I assume that means you have an outlet of type MyMain on your MyAppDelegate, and that the outlet is hooked up to a MyMain object in your nib. In that case, you want to send the setTitleVersion: message to the object in the outlet. If your outlet were named mainObject, you would do it like this:

    [self.mainObject setTitleVersion:version];
    

    If you haven’t created an outlet in MyAppDelegate yet, you can create it and hook it up in one step using Xcode’s assistant editor. Open the assistant editor and make sure it is showing MyAppDelegate.h. Then control-drag from the MyMain object in the nib into your @interface MyAppDelegate, like this:

    create and connect new outlet

    If you already have an outlet declared in your MyAppDelegate, you can connect it in the nib editor. Control-click on the My App Delegate placeholder in the nib’s Objects list. Then, in the outlets pop-up, drag from the outlet’s circle to the MyMain object placeholder, like this:

    connect existing outlet

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

Sidebar

Related Questions

I am using this in my appdelegate's applicationDidFinishLaunching: method to make sure the iPhone
I currently have this method: -(void)seperateGuides { DLog(GetGuideListCount: %i, [[appDelegate getGuideList] count]); columnOneArray =
I've enabled ARC, In my didFinishLaunchingWithOptions method, I wrote the following code: AppDelegate.h: @interface
i have this method - NSArray *objects = [NSArray arrayWithObjects:appDelegate.UserID,itemName.text,@1,@1,itemDegem.text,itemDescription.text, nil]; NSArray *keys =
I added a applicationShouldOpenUntitledFile method to my application delegate, returning NO as Apple's documentation
I have this in my app delegate applicationDidFinishLaunching method: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
I want to change an image of an UIImageView from the applicationDidFinishLaunching method of
I have this method in App Delegate that makes a window and content view
My app consists of 3 views. I've defined 3 helper methods in the AppDelegate
AppDelegate has a parameter called user, and user has two parameters called userId &

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.