I have an iPad app, using XCode 4.5, iOS 6.0 and Storyboards. I need to create a NSCompoundPredicate using a NSDate, which I am given by the user selecting from UIDatePicker. The examples I have seen show the use of NSCalendar and NSCalendarComponents, both of which use the "default" calendar.
This is the code, using one NSPredicate, which works but gets all of the records for that date and all dates in the future, which is wrong.
NSMutableArray *apptDataArray = [NSMutableArray new];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(aStartTime = %@)", [dict objectForKey:@"selectedDate"]];
I need to use a NSCompoundPredicate because I need to get all of the records for a particular date (from 1 minute after midnight to midnight of the selected date).
Is there a way to create two NSDates (begin and end of the day) for the NSCompoundPredicate from a given NSDate, in this case: [dict objectForKey:@"selectedDate"] (which is a NSDate)? (This question is NOT a duplicate of this which uses the NSCalendar code mentioned above.)
UPDATE: updated question in bold.