• 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
Core Data compare NSNumber question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data compare NSNumber question


  • Subject: Core Data compare NSNumber question
  • From: Ryan Moniz <email@hidden>
  • Date: Fri, 23 Dec 2005 20:02:06 -0700
  • Priority: normal

Hi,

I have been fighting with this problem for days, and after reading
most of the documentation and performing various tutorials I still
can't get this to work properly.

My Model is:
Entity: Time
Attributes: time(Double), celltype(String), cellNumber(Int 32), ...

I want to get an array with objects at a specified time.
- (NSArray *)getObjectsForTime:(NSNumber *)aTime {
NSDictionary *entityDict = [managedObjectModel
entitiesByName];
NSEntityDescription *entityDescription = [entityDict
valueForKey:@"Time"];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:entityDescription];
NSPredicate *predicate = [NSPredicate
predicateWithFormat:@"time = %@", aTime ];
[fetchRequest setPredicate:predicate];
NSArray *array = [[managedObjectContext
executeFetchRequest:fetchRequest error:nil] retain];

[fetchRequest release];

return [array autorelease];
}

after the data is loaded, and this method is called I get:
array = (null)

but in the GUI I can using the Search field and can get the cells
according to the time I specify.

My time data is stored as 0.00, 0.10, 0.20, etc.

Can anyone please point out or suggest something please, this has
been a very frustrating experience.

Thanks.

Ryan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Core Data compare NSNumber question
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: KVO one-step listening but two-step notifying?
  • Next by Date: Re: Core Data compare NSNumber question
  • Previous by thread: Re: Crash in objc_msgSend_rtp when calling add action of NSArrayController (SOLVED)
  • Next by thread: Re: Core Data compare NSNumber question
  • Index(es):
    • Date
    • Thread