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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:45:28+00:00 2026-05-13T07:45:28+00:00

I have an AppController class that looks after view/control in my app in the

  • 0

I have an AppController class that looks after view/control in my app in the usual way.

There’s a button on my app’s main window in IB that causes AppController to instantiate a new window controller (accountPanelController) and show that secondary window:

- (IBAction) showAccountPanel:(id) sender
{
    //Is accountController nil?
    if (!accountPanelController) {
        accountPanelController = [[AccountPanelController alloc] init];
    }

    [accountPanelController showWindow:self];
}

When that new window is done with, I want to send the data collected from my secondary window controller to a method in AppController:

- (IBAction) close: (id) sender
{
    NSLog(@"Close detected");
    [AppController addAccount:0];
    [self close];
}

However, when I try and call the addAccount method in AppController from the new window controller, I get an “‘AppController’ may not respond to ‘+addAccount'” warning.

This seems to be related to AppController being a class rather than an object instantiation, since the method in AppController is called -addAccount (rather than the +addAccount reported in the warning). Indeed, if I change the name of the target method to +addAccount instead of -addAccount, the warning does not appear (but the program crashes on execution).

Given that I don’t actually instantiate AppController myself (I guess that happens somehow during NIB initiation), does anyone have any ideas how I can send the data to the AppController method? Notifications seem like overkill…

Many thanks.

  • 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-13T07:45:28+00:00Added an answer on May 13, 2026 at 7:45 am

    I recommend the following introduction article on Apple’s Mac Dev Center: Communicate with Objects – #Notifications
    Update:
    I pointed the link to to relevant anchor (Notifications).

    The problem in your code sample is, that you call a class method (those with a +), but you implement an instance method (-).
    So a simple fix would be, to get the (shared)instance of your AppController (probably self in your code) and send it the addAccount: message.
    But I encourage you to read the article first.

    Maybe you can solve your problem by sending a notification (NSNotification) from your view to your controller.

    Update:
    Another interesting read for you might be this SO question regarding the difference between class methods and instance methods.

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

Sidebar

Related Questions

I'm creating a game that uses cards. I have an AppController class with one
I have a two classes, a controller called AppController and a class called URLDelegate
I have a custom class that has quite a few accessor methods for customizing
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have a n-tire web application and search often times out after 30 secs. How
I have a function in my Comic Model as such: <?php class Comic extends
I have a Cocoa/Objective-C program, I set it up the way it wants, with
I have an interface that has large numbers of controls, see image below. Interface
I have two tables, Pages and Posts that are in HABTM and are joined

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.