• 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: Problem using custom entity class with subclasses NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using custom entity class with subclasses NSArrayController


  • Subject: Re: Problem using custom entity class with subclasses NSArrayController
  • From: mmalcolm crawford <email@hidden>
  • Date: Thu, 18 May 2006 13:37:57 -0700


On May 18, 2006, at 1:27 PM, David Groulx wrote:

I subclassed NSArrayController to override its -(IBAction)add: method. Within that method I create a new entity with the code:
NSManagedObjectContext* moc =
[[NSApp delegate] managedObjectContext];
NSManagedObjectModel* mom =
[[moc persistentStoreCoordinator] managedObjectModel];
NSEntityDescription* entity =
[[mom entitiesByName] objectForKey:@"Uda"];
NSManagedObject* newUda =
[[NSManagedObject alloc] initWithEntity:entity
insertIntoManagedObjectContext:moc];
[self addObject:newUda];
and that worked fine.


It's not clear why you're doing this? What does this add to the default implementation of add:?
And if you do need to customise the behaviour of add:, why not just invoke newObject?


Now I need to use a custom class for this entity, but I get the
error
Attempt to create an NSManagedObject that does NOT correspond to the proper Class from the NSEntityDescription.


Is the entity name for the controller "Uda"?

mmalc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem using custom entity class with subclasses NSArrayController
      • From: mmalcolm crawford <email@hidden>
    • Re: Problem using custom entity class with subclasses NSArrayController
      • From: David Groulx <email@hidden>
References: 
 >Problem using custom entity class with subclasses NSArrayController (From: David Groulx <email@hidden>)

  • Prev by Date: Re: How do I find out if a process is running if I have the process Name?
  • Next by Date: Re: Binding to Accessors of Application Delegate
  • Previous by thread: Problem using custom entity class with subclasses NSArrayController
  • Next by thread: Re: Problem using custom entity class with subclasses NSArrayController
  • Index(es):
    • Date
    • Thread