• 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
-[NSManagedObject objectID]: unrecognized selector sent to class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-[NSManagedObject objectID]: unrecognized selector sent to class


  • Subject: -[NSManagedObject objectID]: unrecognized selector sent to class
  • From: Matt Bigarani <email@hidden>
  • Date: Thu, 4 Mar 2010 11:32:57 -0800

Hey all,

I'm experiencing some weirdness with NSManagedObject. Basic
background, I have an NSManagedObject 'surveyGroup', which has a
to-many relationship to another NSManagedObject, surveyResults.

I'm attempting to access the surveyResults object in two different
methods. It works fine in the first method, but in the second method I
get the error:

"-[NSManagedObject objectID]: unrecognized selector sent to class"

When trying to access any of the properties of the surveyResult
object. If I comment out the first method, the second method is able
to access the properties of the surveyResult object without error.

Am I doing anything obviously wrong here that would leave surveyResult
un-usable the next time I try to access it?

NSUInteger index = 0;
NSMutableSet *surveyResultSet = [group mutableSetValueForKey:@"survey_results"];
NSMutableArray * surveyResultArray = [[NSMutableArray alloc] init];
[surveyResultArray addObjectsFromArray:[surveyResultSet allObjects]];

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]
initWithKey:@"date" ascending:YES];
[surveyResultArray sortUsingDescriptors:[NSArray
arrayWithObject:sortDescriptor]];
[sortDescriptor release];

NSManagedObject * surveyResult = [surveyResultArray objectAtIndex:index];
NSManagedObject * survey           = [surveyResult valueForKey:@"survey"];
NSString * surveyName                 = [survey valueForKey:@"name"];

NSString * title = [NSString stringWithFormat:@"%@", surveyName];

[surveyResultArray release];

return title;
_______________________________________________

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: -[NSManagedObject objectID]: unrecognized selector sent to class
      • From: Joanna Carter <email@hidden>
    • Re: -[NSManagedObject objectID]: unrecognized selector sent to class
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Uninitialized rectangle??
  • Next by Date: Interface Builder : moving a controller to File's Owner
  • Previous by thread: Re: NSOutlineView: items can't be referenced with path?
  • Next by thread: Re: -[NSManagedObject objectID]: unrecognized selector sent to class
  • Index(es):
    • Date
    • Thread