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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:04:36+00:00 2026-06-18T09:04:36+00:00

I have a class that at some point gets a bunch of data with

  • 0

I have a class that at some point gets a bunch of data with a Core Data fetch and then inserts the objects, created in the usual Core Data way in XCode and therefore derived from NSManagedObject, into an NSMutableSet. Depending on how things work out, some of these objects might end up in several other sets. So far, so good.

But then the following happens:

NSMutableArray* anArray = [NSMutableArray alloc] init;
[currentResults minus:previousResults]; // both are NSMutableSets
for(MyObject* obj in currentResults)
{
   [anArray addObject:[createAnnoFromMyObject:obj]]; // nastiness happens here
}

All createAnnoFromMyObj: does is pull data out of obj and return a object that implements MKAnnotation.

The problem is that although I get an array of usable annotations, currentResults, previousResults, and any other objects that references any of the MyObjects that were touched by createAnnoFromMyObject: end up getting trashed.

By trashed I mean that trying to access them results in an exception along the lines of

-[MyObject beginningOfDocument]: unrecognized selector sent to instance...

The same happens when trying to view any of these collections in the debugger pane with the po command.

We tried regenerating MyObject in Core Data but no luck. There is very little mention of this beginningOfDocument selector on Google and we have no idea what coudl be wrong. Although we have a workaround that will probably eliminate this issue, it would be really nice to know what is going on.

  • 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-06-18T09:04:37+00:00Added an answer on June 18, 2026 at 9:04 am

    I also ran into this specific unrecognized selector problem – that beginningOfDocument was being called on my (subclass of) NSManagedObject instance in iOS5.x. The problem looks to be fixed in iOS6 though. I also verified that NSZombies gave me nothing, even though it certainly seemed like the right intuition.

    The unrecognized selector exception was thrown during a valueForKey lookup on our managed object, so it’s worth looking at the stack trace to see if this is where the exception is thrown for you as well.

    In our case, the “broken” key was fullText, the name of one of our attributes. Changing the name eliminated the problem. My guess is that the name caused an error in the underlying sqlite query (I didn’t think fulltext was a keyword, but maybe for the full text searching in sqlite?), and perhaps the query arguments are better sanitized in iOS6.

    You can find out what key/attribute name is broken with this little cheat: Override your valueForKey: method temporarily to NSLog and then just call the superclass version and return it. Even though the docs say not to override it (which we’re only doing for a moment to find the offending attribute), this is ok since we’re just overriding and then calling the superclass implementation.

    // Don't forget to remove me after the bug is fixed!
    - (id)valueForKey:(NSString *)key {
        NSLog(@"Finding value for key: %@", key);
        return [super valueForKey:key];
    }
    

    Then when you run again, you’ll see the last call to valueForKey: before the crash and know what attribute name is broken.

    If you’re still having trouble sorting out which was the unsuccessful lookup, you could go with the more verbose:

    // Don't forget to remove me after the bug is fixed!
    - (id)valueForKey:(NSString *)key {
        NSLog(@"Finding value for key: %@", key);
        id retVal = [super valueForKey:key];
        NSLog(@"Success for key: %@", key); // or print retVal for fun
        return retVal;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a class that processes some data: class SomeClass { public: void
I have a class that contains data from some model. This class has metadata
I have some class that I'm passing as a result of a service method,
I have a C# class that has some functionality that I'd like to allow
I have a simple class that contains some general information about the current web
the basic idea is that you have some class that has a reference type
I have a class that I need to perform some actions on but I
I have a static util class that does some string manipulation on a bit
I have a class includes.vb that holds some variables (sharing them with other pages)
I have a simple Java class that has some methods: public class Utils {

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.