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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:48:20+00:00 2026-05-19T01:48:20+00:00

I have a NSArrayController bound to a NSTableView. With this I have the typical

  • 0

I have a NSArrayController bound to a NSTableView. With this I have the typical Add/Remove buttons.

While Adding an item is very straight forward (I call a method, create an object with default values and add it) I have problems deleting objects from the controller.
I know I can do this the easy way when connecting the button with the remove action from the ArrayController. But this is not what I want. I need to remove the object manually because I have some additional code to process.

Anway, removing objects seems far more complcated then I expected. It already tried:

NSArray *items =  [doToItemsArrayController selectedObjects];
[doToItemsArrayController removeSelectedObjects:items]; 

or

NSIndexSet *iSet = [doToItemsArrayController selectionIndexes];
[doToItemsArrayController removeSelectionIndexes:iSet];

None of them seems to work. How do I remove the selected Object from an NSArrayController with Objective-C code?

  • 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-19T01:48:20+00:00Added an answer on May 19, 2026 at 1:48 am

    You can remove objects using any of these methods. They are independent from the selection.

    – removeObjectAtArrangedObjectIndex:
    – removeObjectsAtArrangedObjectIndexes:
    – remove:
    – removeObject:
    – removeObjects:
    

    If you want to remove the selected object from the content array, then you can get the selected object(s) using the below methods and then plug it into one of the methods mentioned above.

    – selectionIndex
    – selectionIndexes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with a bound property of a custom view. The property
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
I have a set of data created by another app and stored in XML
Have I correctly added an element to a hashTable? Flows flows = new Flows(sIP,dIP);
I'm looking for a way to monitor/observe a singleton class I'm using to pass
I am trying to make a duplicate of an existing NSManagedObject and related sub-objects
I've looked on SO for examples of using Key Value Observing with an NSArray
In my document Core Data application I receive crash with report in console: Cocoa
Is it possible to pass the pointer to an object in a drag and
Can anyone explain differences in practise between NSArrayContoller modes (Class / Entity}? I am

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.