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 6337971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:21:13+00:00 2026-05-24T19:21:13+00:00

Sometimes I got error saying that unrecognized selector objcType was sent to an NSDate

  • 0

Sometimes I got error saying that unrecognized selector objcType was sent to an NSDate object:

2011-06-11 14:44:51.589 MyApp[354:307] -[__NSDate objCType]:
unrecognized selector sent to instance 0x4b0d5a0

2011-06-11 14:44:51.732 MyApp[354:307] * Terminating app due to
uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSDate
objCType]: unrecognized selector sent to instance 0x4b0d5a0’

What I do is loading data from sqLite using Core Data by calling [[self fetchedResultsController] performFetch:&error]. I use a predicate, which ensures that the only (NSManaged)objects having their attribute kickoffTime of type NSDate in a specified range are fetched:

NSDate * fromDate = ...
NSDate * toDate = ...
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"( ( %@ <= kickoffTime +0 ) && ( kickoffTime +0 <= %@ ) )", fromDate, toDate];

// Add the predicate to the fetchRequest
[[[self fetchedResultsController] fetchRequest] setPredicate:predicate];

NSError *error;

if (![[self fetchedResultsController] performFetch:&error]) 
{
    ...
}

I do not really know what the problem might be. I probably misuse the core data predicate in some way, forcing the framework to send the objCType message to NSDate object in order to find out type of the object. Does anybody have some suggestions?

Here is a few things I have observed:

  • the NSDate object to which is sent the problematic selector is the kickoffTime attribute of my NSManagedObject
  • it happens pretty randomly so it is not easy to reproduce
  • the NSDate object to which the unrecognized selector is sent appears to be valid object (I could print it out in gdb)

Here is the top of the stack:

0 CoreFoundation 0x3587a987
__exceptionPreprocess + 114

1 libobjc.A.dylib 0x34a8249d
objc_exception_throw + 24

2 CoreFoundation 0x3587c133
-[NSObject(NSObject) doesNotRecognizeSelector:] + 102

3 CoreFoundation 0x35823aa9 forwarding +
508

4 CoreFoundation 0x35823860
_CF_forwarding_prep_0 + 48

5 Foundation 0x3121ac69
+[_NSPredicateUtilities add:to:] + 40

6 Foundation 0x31221225
-[NSFunctionExpression expressionValueWithObject:context:] + 688

7 Foundation 0x3117e045
-[NSComparisonPredicate evaluateWithObject:substitutionVariables:] +
176

8 Foundation 0x312255fb
-[NSCompoundPredicateOperator
evaluatePredicates:withObject:substitutionVariables:] + 186

9 Foundation 0x3121e43f
-[NSCompoundPredicate evaluateWithObject:substitutionVariables:] + 186

10 Foundation 0x3117df8d -[NSPredicate
evaluateWithObject:] + 16

11 CoreData 0x356e8edf
-[NSManagedObjectContext executeFetchRequest:error:] + 2014

12 CoreData 0x357a041b
-[NSFetchedResultsController performFetch:] + 766

13 MyApp 0x000195ef
-[MatchesCalendarDataSource loadMatchesFrom:to:delegate:] + 138

  • 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-24T19:21:13+00:00Added an answer on May 24, 2026 at 7:21 pm

    The objcType is a selector/method of NSValue and its subclasses like NSNumber. That means that the NSDate object is being treated like a NSValue at some point. It most likely happens when the NSDate is being wedged into a mathematical operation which it doesn’t support.

    In a predicate, a NSDate will often be converted to a NSTimeInterval which is a double. If you log the predicate you have above, the date will resolve something like this:

    CAST(335110182.022141, "NSDate") <= kickoffTime + 0 AND kickoffTime + 0 <= CAST(335110182.022141, "NSDate")
    

    … which is the NSDate being cast to a double. That is where your problem comes from. I suspect it arises because the predicate parser cannot always resolve the precedence.

    You can probably resolve the problem just by:

    (CAST(335110182.022141, "NSDate") <= kickoffTime + 0) AND (kickoffTime + 0 <= CAST(335110182.022141, "NSDate"))
    

    However, the +0 does absolutely nothing in a predicate besides cause problems so I would just lose it.

    BTW when you say:

    What I do is loading data from sqLite using Core Data by calling

    … that suggest that you are thinking of Core Data as an object wrapper for sqlite. It isn’t and thinking that way will get you into trouble especially with predicates.

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

Sidebar

Related Questions

I've got some LINQ to SQL that sometimes throws a Cannot insert duplicate key
I've got a program that periodically updates its database schema. Sometimes, one of the
We've got an ASP.Net 2.0 (VS2005) application that works fine locally, but sometimes loses
I'm trying to debug an error I got on a production server. Sometimes MySQL
I've got a piece of an application that reads input sometimes from a file,
I've got a problem in my database - somehow changes sometimes are not being
I got a little problem. Sometimes, when I try to call the following code,
Sometimes my c++ program crashes in debug mode, and what I got is a
So I've got 3 different columns (basket 1, 2, and 3). Sometimes these columns
I am learning F#. I got the latest May 2009 CTP. Sometimes when compiling

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.