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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:58:39+00:00 2026-05-23T10:58:39+00:00

Update: This thread identifies a bug in NSCollectionView when the represented objects of the

  • 0

Update:
This thread identifies a bug in NSCollectionView when the represented objects of the collection view are NSManagedObjects. The bug is triggered as follows;

(a) Delete objects from the NSArrayController
(b) Perform save on the related nsmanagedobjectcontext any time after the deletion and before the NSCollectionView has finished its animation.

These projects on github demonstrate the issue.

https://github.com/artifacts/NSCollectionViewCoreDataBug
https://github.com/iracooke/CoreDataCollectionViewCrashing

Original question below

I have an NSCollectionView setup with its content binding bound to arrangedObjects of an NSArrayController of core-data entities. In my Collection Item View (the prototype for the NSCollectionView view) I have several controls bound via representedObject of my collectionview item to my core-data entities.

For the most part this works OK.

I encounter an objc_exception when I try to delete entities from my ArrayController. I delete these entities simply by calling;

[myArrayController removeObject:managedObjectToDelete];

Unfortunately, when I do this I frequently get a “CoreData could not fulfill a fault” Error .. with the responsible entity being one of the entities being managed by the NSArrayController.

Examination of the call-stack when the exception is thrown reveals that the crash originates when the NSCollectionView receives its _endOfAnimation method. This in turn initiates other methods to do with unbinding (likely of properties of my entity with controls in my view).

One further bit of info is that the Entity I’m working with has no relationships to other entities in my model.

It looks to me as though the following problem is occurring;

  • When I delete objects from my NSArrayController they are in turn deleted from the context.
  • After deletion from the context the objects are turned into faults
  • The NSCollectionView has retained references to the objects (now faults). It tries to clean them up at the end of its animation (unbinding etc).
  • When NSCollectionView tries to cleanup bindings to the object it causes core data to attempt to fire a fault on the object (hope I got my terminology right there). This causes an error because the object has not yet been saved to disk.

The only way I can think of to prevent this, is to persist the objects in the store (by saving them) prior to deletion. This works, but only in a hackish kind of way since I need to ensure that one round of deletion is complete before saving again … and since the error occurs during an animation .. after some delay .. and two saves in succession would result in the same error occuring again.

Does this mean that I cannot used a Core-Data backed NSArrayController to populate an NSCollectionView? If not what am I doing wrong? Is there a better way around this issue?

  • 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-23T10:58:40+00:00Added an answer on May 23, 2026 at 10:58 am

    A direct yet boring answer: I can confirm that a Core Data backed NSArrayController can populate an NSCollectionView, with different GUI objects in the collection NSView item bound to the generated “Collection View Item” and referring to various Core Data objects along the path. Programmatically deleting (and re-ordering) elements of the NSArrayController works (with animation for free).

    Perhaps some bindings or other dependencies inside your Collection View are causing the problem? Or a threading issue with the Managed Object Context(s)?

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

Sidebar

Related Questions

UPDATE 1/31/10 : Since this thread continues to get a lot of views...I am
I got this error when trying to update an image. It was a cross-thread
I found information from this thread and am starting to wonder if the information
After getting an answer from this thread, it would save me alot of retyping
Update: Note that this thread does not applyt o recent versions of Emacs (24+).
The question posted in this thread asks how to update a ListView when the
I've got this Thread that is supposed to Update the game's elements, i.e. repaint,
Update: This post was from when I was learning android with android 2.2, be
Update: This turned into a blog post, with updated links and code, over at
Update: this question, including the title, was rephrased, see history for details I know

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.