سؤال

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".
هل كانت مفيدة؟

المحلول

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];
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top