• 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
Having problem with fetch request in NSDocument based application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Having problem with fetch request in NSDocument based application


  • Subject: Having problem with fetch request in NSDocument based application
  • From: Clayton Leitch <email@hidden>
  • Date: Fri, 04 Sep 2009 09:47:07 -0400

Here is the code in MyDocument:
-(IBAction)calculateStat:(id)sender{
fetchedObjects = nil;
context = [self managedObjectContext];
fetchRequest = [[NSFetchRequest alloc] init];
entity = [NSEntityDescription entityForName:@"Measurement" inManagedObjectContext:context];
[fetchRequest setEntity:entity];
fetchedObjects = [context executeFetchRequest:fetchRequest error:&error];
if (fetchedObjects == nil) {
NSLog(@"error");
[errorMessage setStringValue:@"no objects"];
}else {
[errorMessage setIntValue:[fetchedObjects count]];
}



[fetchRequest release];
The fetchedObjects count is always 0. Any idea what silly thing I forgot.


Thanks
_______________________________________________

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: Having problem with fetch request in NSDocument based application
      • From: "I. Savant" <email@hidden>
    • Re: Having problem with fetch request in NSDocument based application
      • From: Andy Lee <email@hidden>
    • Re: Having problem with fetch request in NSDocument based application
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: What about revamping OpenUp.app for Snow Leopard?
  • Next by Date: Re: Having problem with fetch request in NSDocument based application
  • Previous by thread: Re: Problem with Core Midi on 10.6
  • Next by thread: Re: Having problem with fetch request in NSDocument based application
  • Index(es):
    • Date
    • Thread