Domanda

enter image description here

  • Here in my application User set list of task to do in weekdays. So I am rescheduling each task at every Friday when user opens the app. So I want to know the list of notification which are left.
  • so What I Need Want to Predicate Timeid or weekday from "ScheduleArray".
È stato utile?

Soluzione

Just use:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"userInfo.WeekDay = %d", yourWeekDay];

or:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"userInfo.Timeid = %d", yourTimeID];

Then:

NSArray *notifications = [[[UIApplication sharedApplication] scheduledLocalNotifications] filteredArrayUsingPredicate:predicate];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top