• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Two Array Controllers, loading from CoreData, without a contentArray...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Two Array Controllers, loading from CoreData, without a contentArray...


  • Subject: Two Array Controllers, loading from CoreData, without a contentArray...
  • From: Jim Thomason <email@hidden>
  • Date: Tue, 22 Sep 2015 08:40:53 -0500

First, to be clear, I'm not actually trying to do this. I'm just curious
how it could be done. I cooked it up while working on other things.

The question is simple - is there a reasonable way to create two
NSArrayControllers, have them bound to an entity through CoreData, and keep
them in sync?

So there's ControllerA, which populates TableA; and ControllerB, which
populates TableB. Neither of them have an explicit bound contentArray, they
just load up all of their associated entities straight from the
managedObjectContext.

I'd like to be able to add an object into ControllerA, and have it
automatically show up in ControllerB. I haven't figured out a way to do it.

If they were both bound to the same contentArray, it's no problem - the
content automatically shows up. But if it's loaded via the fetch request,
then some other mechanism needs to come into play.

Subclassing them both and having A post a notification so that B re-fetches
its content is the best solution I've got, but I figured I'd ask around and
see if anybody else had a more clever approach.

-Jim...
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Two Array Controllers, loading from CoreData, without a contentArray...
      • From: Richard Charles <email@hidden>
    • Re: Two Array Controllers, loading from CoreData, without a contentArray...
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: Saving window and view state with NSDocument
  • Next by Date: Localised alert/confirm message
  • Previous by thread: About App size after using app thinning.
  • Next by thread: Re: Two Array Controllers, loading from CoreData, without a contentArray...
  • Index(es):
    • Date
    • Thread