filter child entities collections with predicate in IOS (objective c )? -
i want set predicate on fire date.
attribute alerts of entity history nsorderset.
nsfetchrequest *fetchrequest = [[nsfetchrequest alloc]initwithentityname:@"history"]; nstimeinterval interval = [[nsdate date] timeintervalsince1970]; nsdate *tempcurrent = [nsdate datewithtimeintervalsince1970:interval]; // firetime nspredicate *predicate = [nspredicate predicatewithformat:@"alerts.firetime < %@", tempcurrent]; [fetchrequest setpredicate:predicate]; [[managedobjectcontext executefetchrequest:fetchrequest error:nil] count]; nsinteger count = [managedobjectcontext countforfetchrequest:fetchrequest error:nil]; nslog(@"%li",(long)count);`
problem fetched objects count equal zero. no data fetched core data.
Comments
Post a Comment