• 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: Custom NSManagedObject Class Initializer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom NSManagedObject Class Initializer


  • Subject: Re: Custom NSManagedObject Class Initializer
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 15 Mar 2009 00:03:19 -0400

On Sat, Mar 14, 2009 at 11:02 PM, Richard Somers
<email@hidden> wrote:
> I have a custom NSManagedObject class MyEntity. It works just fine. However
> when I add an initializer and override the superclass's designated
> initializer an error occurs.

Not only should you not do this, if you do you really need to return
the result of super's implementation.

- (id)initWithEntity:(NSEntityDescription *)desc
insertIntoManagedObjectContext:(NSManagedObjectContext *)ctx
{
  if(self = [super initWithEntity:desc insertIntoManagedObjectContext:ctx])
  {
     // do things here
  }

  return self;
}

--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: Custom NSManagedObject Class Initializer
      • From: Benjamin Dobson <email@hidden>
References: 
 >Custom NSManagedObject Class Initializer (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: Custom NSManagedObject Class Initializer
  • Next by Date: Re: Performance problem with GC enabled
  • Previous by thread: Re: Custom NSManagedObject Class Initializer
  • Next by thread: Re: Custom NSManagedObject Class Initializer
  • Index(es):
    • Date
    • Thread