• 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: Core Data App With Auxiliary Panel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data App With Auxiliary Panel


  • Subject: Re: Core Data App With Auxiliary Panel
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 31 Jul 2009 20:33:12 -0700

On Jul 31, 2009, at 8:03 PM, Richard Somers <email@hidden> wrote:

@interface AuxPanelController : NSWindowController
{
@private
   NSManagedObjectContext *managedObjectContext;
}

@implementation AuxPanelController

- (id)init
{
   if (![super initWithWindowNibName:@"AuxPanel"])

Unrelated note: you need to assign self = [super initWithWindowName: …].


- (NSManagedObjectContext *)managedObjectContext
{
   return [[self document] managedObjectContext];

If you're doing this why do you have an ivar?

In the running application the auxiliary panel displays properly but an error message is produced: "Cannot perform operation without a managed object context".

Because you have a managedObjectContext ivar, you never change its value so it defaults to nil, and +[NSObject(NSKeyValueCoding) accessInstanceVariablesDirectly] returns YES, -[AuxPanelController objectForKey:@"managedObjectContext"] will always return nil. Ditch the ivar.


--Kyle Sluder

_______________________________________________

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: Core Data App With Auxiliary Panel
      • From: Kyle Sluder <email@hidden>
    • Re: Core Data App With Auxiliary Panel
      • From: Richard Somers <email@hidden>
References: 
 >Core Data App With Auxiliary Panel (From: Richard Somers <email@hidden>)

  • Prev by Date: How do I delete NSCollectionView item on right click?
  • Next by Date: IPhone Textview question
  • Previous by thread: Core Data App With Auxiliary Panel
  • Next by thread: Re: Core Data App With Auxiliary Panel
  • Index(es):
    • Date
    • Thread