Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 404115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:16:43+00:00 2026-05-12T17:16:43+00:00

I have a NSManagedObject subclass, created by the XCode model interface. This class has

  • 0

I have a NSManagedObject subclass, created by the XCode model interface.
This class has some NSString and NSNumber members, and a NSDate member.

When I try to set the NSDate member, I get the following exception:
2009-10-12 21:53:32.228 xxx[2435:20b] Failed to call designated initializer on NSManagedObject class 'Item'
2009-10-12 21:53:32.228 xxx[2435:20b] *** -[Item setDate:]: unrecognized selector sent to instance 0x3f7ed30
2009-10-12 21:53:32.229 xxx[2435:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[Item setDate:]: unrecognized selector sent to instance 0x3f7ed30'

The date parameter is just like the others, except that instead of being a

@property (nonatomic, retain) NS{String,Number}* propname;  

it’s a

@property (nonatomic, retain) NSDate *date;

Btw, the Item instance I’m assigning on is just a regular [[Item alloc] init], no associated context or anything.

First I thought my NSDate* was faulty, then I tried assigning it [NSDate date], and even nil. It still crashes.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:16:44+00:00Added an answer on May 12, 2026 at 5:16 pm

    You can’t instantiate an NSManagedObject subclass without an associated NSManagedObjectContext (well you can as you’ve shown, but the results will almost certainly not be what you want).

    The first line of the log hints at this:

    2009-10-12 21:53:32.228 xxx[2435:20b] Failed to call designated initializer on NSManagedObject class 'Item'
    

    All Objective-C classes have (by convention) a designated initializer, which is the initializer method that must be called, either explicitly or via an other convenience initializer. In the case of NSManagedObject this is -[NSManagedObject initWithEntity:insertIntoManagedObjectContext:]. Failure to cause the designated initializer leads to undefined, and likely incorrect, behavior because the instance is not guaranteed to be properly initialized. I would guess that the NSManagedObject initializer sets up the machinery to support @synthesize‘d property access for the Entity’s attributes. Without this machinery, the instance may not think it can respond to the @synthesize‘d calls and your call to setData: will cause a selector not found error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CoreData NSManagedObject subclass, TextNarration, that has an attribute of type NSString,
I have one subclass of NSManagedObject like following and stored some instances by NSManagedObjectContext.
I have an Offer class (NSManagedObject subclass) that I want to use to handle
I have a CoreData model (managed object) called Item: @interface Item : NSManagedObject {
I have a Core Data model with an NSDate property. I want to filter
I have a custom NSManagedObject subclass, say, Person . I also have a UIView
I'm using a SQLite persistent store. I have a NSManagedObject class Den with a
Have you managed to get Aptana Studio debugging to work? I tried following this,
In my project I have some objects that I show from a server, lets
Suppose (for the sake of argument) that I have a view class which contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.