Core Data compare NSNumber question
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