i have a weird exeption when i debug my app on my device. debugging in simulator works as expected.
- i use core data for storing my data
- relationships in model are as follows: Location <-> LocationDetails ->> HappyHour
- i use NSFetchedResultsController to populate a UITableView
- i'm also pretty new to objective-c develpoment
i need to have a SUBQUERY to get to the attributes of the HappyHour entity.
Like this:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(0 != SUBQUERY(details.%K, $hh, ($hh.startTime < %@) AND ($hh.endTime > %@)).@count)", weekdayString, theDate, theDate];
ONLY on the DEVICE i get this error/exeption:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to generate SQL for predicate (0 != SUBQUERY(details.hh_montag, $hh, $hh.startTime < CAST(316482000.000000, "NSDate") AND $hh.endTime > CAST(316482000.000000, "NSDate")).@count) (problem on RHS)'
0 CoreFoundation 0x32cf964f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3313cc5d objc_exception_throw + 24
2 CoreData 0x3228a829 -[NSSQLGenerator newSQLStatementForFetchRequest:ignoreInheritance:countOnly:nestingLevel:] + 688
3 CoreData 0x3228a2eb -[NSSQLAdapter _newSelectStatementWithFetchRequest:ignoreInheritance:] + 378
4 CoreData 0x3228a169 -[NSSQLAdapter newSelectStatementWithFetchRequest:] + 16
5 CoreData 0x3228a005 -[NSSQLCore newRowsForFetchPlan:] + 288
6 CoreData 0x322892c5 -[NSSQLCore objectsForFetchRequest:inContext:] + 420
7 CoreData 0x32288875 -[NSSQLCore executeRequest:withContext:error:] + 304
8 CoreData 0x32287dd5 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 896
9 CoreData 0x3228669f -[NSManagedObjectContext executeFetchRequest:error:] + 374
10 CoreData 0x322b9d7f -[NSFetchedResultsController performFetch:] + 766
11 HappyHourRadar 0x0003e723 -[ResultViewController viewDidLoad] + 86
...
terminate called after throwing an instance of 'NSException'
Signal received: SIGABRT (Aborted)
Process finished with exit code -1
At [ResultViewController viewDidLoad] +86
i call
[self fetchedResultsController] performFetch:&error]
in the console i also get this message:
unable to load symbol file: unable to load symbol file: warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
As i haven't found anything that could help me, i guess it's either something really weird, or i just messed up something pretty standard, that i can't find because of my limited objective c background...
Anyway, i would be very glad if someone could give a hint, so i can continue without having to rewrite my entire application model layer to something dirty (like fetching all entries and holding them in an array and process filter functions...stuff like that ;) )
edit:
here is the model graph. from this auto-generated the model files.
generated HappyHour class:
@interface HappyHour : NSManagedObject
{
}
@property (nonatomic, retain) NSDate * endTime;
@property (nonatomic, retain) NSDate * startTime;
@end