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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:18:08+00:00 2026-05-20T05:18:08+00:00

Like the titles says, I want to specify the super of an NSArrayController ,

  • 0

Like the titles says, I want to specify the super of an NSArrayController, something along the lines of self = [super[NSArrayController] function], but have had no luck searching for this. Any ideas? Thanks in advance.

Edited to remove abstract examples as they’re confusing people as to the nature of my question.

The purpose of this is to programmatically do what a simple binding of ‘add’ from an NSArrayController to an NSButton would do in IB. There are several arrayControllers in my application so I want to be able to specify which one I want to obtain the super of by code.

The reason I am looking for the super of an NSArrayController is because I am under the impression that one should address the model rather than the controller (NSArrayController) and my model is a Core Data model that I believe I could get to by using the super of an NSArrayController I specify by name. Perhaps there is a more direct way of adding to the data model.

  • 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-20T05:18:08+00:00Added an answer on May 20, 2026 at 5:18 am

    You’re asking a wrong question.

    First, let’s distinguish a class and an instance of the class. Note that there can be, and indeed often are, multiple instances of the same class.

    A class C can be a subclass of another class A. Then A is the superclass of C. Suppose you have an instance c of the class C. Then, in the implementation of the methods of the class C, self stands for the instance of c itself, and super stands for the instance of c as an instance of its superclass A. In a sense, an instance of the class C is also an instance of the class A.

    Objects can have other relationships than being super or subclasses. For example, a class C can have in its interface an instance variable B* b; In this case, an instance c of the class C has a pointer to an instance b of the class B. In this case, c is not an instance of the class B.

    The relationship between NSArrayController and the managed object context is one of the latter. An instance of NSArrayController contains a pointer to an instance of NSManagedObjectContext (moc).

    So what you want to do is not to get the super of your NSArrayController. Instead, you want to get the moc associated to the NSArrayController. Now, how do you get it? To find it out, you open the reference in XCode or on the web at the Apple Developer Connection, see here. Do that right now. Go through the methods. You don’t find one giving you the moc.

    Then, you go to the top of that page, and follow the superclass of NSArrayController. See this reference of NSObjectController. Now, go through the list of the methods. You find -[NSObjectController managedObjectContext], which does the job!

    In conclusion: if you want the moc associated to the NSArrayController, you just need to do

    NSManagedObjectContext* moc= [arrayController managedObjectContext];
    

    where arrayController is the instance of the NSArrayController you want to deal with. e.g. If you have multiple instances of NSArrayControllers in the nib, you should have multiple IBOutlets in the app delegate, say, arrayController1, arrayController2, etc. (which are very bad variable names). Then you choose the one you want to deal with.

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

Sidebar

Related Questions

Like the title says, I want to parse XML in my iPhone application, but
Like the title says, I want to have a HTML table that allows its
Like the title says, I want to know what (int (*)()) in a C-define-function-call
Just like the title says; I want to use something like Mid( stringName ,
As title says, I have a list of words, Like stopWords = [the, and,
The titles says it. I want a 2-column CSS layout that: is centered -
As the title says, I'm trying to do something like this: public abstract class
I have a quick question. As the title says, I'd like to find a
As the title says, I want to have a build tool that quite much
As the question's title says, I want to get the system information (like OS

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.