• 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
Re: NSController controllerEditor:didCommit:… exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSController controllerEditor:didCommit:… exception


  • Subject: Re: NSController controllerEditor:didCommit:… exception
  • From: Vincent Habchi <email@hidden>
  • Date: Mon, 15 Nov 2010 14:32:30 +0100

Kyle:

> The main menu nib is kind of funny. It's loaded differently (or at
> least at a different time) than the other nibs. It's much more
> sensitive to timing issues like this.
>
> Who provides the MOC for the controller (another object in the nib?),
> and how is it provided (bindings, -setManagedObjectContext:)?

Yes, the MOC is provided through a binding to the AppController, itself part of the NIB. But the MOC iVar is set to nil until the user successfully opens a persistent store file. So I imagine the init code for the NSArrayController protests against finding a MOC set to nil. But since I don't actually need the array before the MOC is initialized, ignoring the exception it raises does not lead to a fatal error.

I worked around this annoyance by opening a temporary MOC. I imagine I could also decide to remove the controller from the NIB and create it programmatically only when a proper store is opened.

Cheers and thanks for help!
Vincent_______________________________________________

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: NSController controllerEditor:didCommit:… exception
      • From: Kyle Sluder <email@hidden>
References: 
 >NSController controllerEditor:didCommit:… exception (From: vincent habchi <email@hidden>)
 >Re: NSController controllerEditor:didCommit:… exception (From: Quincey Morris <email@hidden>)
 >Re: NSController controllerEditor:didCommit:… exception (From: vincent habchi <email@hidden>)
 >Re: NSController controllerEditor:didCommit:… exception (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: NSController controllerEditor:didCommit:… exception
  • Next by Date: Re: [iPhone] Toolbar button and "Touch Down"
  • Previous by thread: Re: NSController controllerEditor:didCommit:… exception
  • Next by thread: Re: NSController controllerEditor:didCommit:… exception
  • Index(es):
    • Date
    • Thread