evenArray[]
包含本地通知列表- 我有创建本地通知的功能,但它在编辑和添加模块中调用,所以它多次调用并复制本地通知
- 请告诉我如何使用我当前的通知检查此数组中的通知的条件,我将仅在它不重复时创建该通知。
这是通知,我需要哪个参数来将我的通知与这个“144=mas”进行比较,144 是唯一的,索引也是唯一的
"<UIConcreteLocalNotification: 0x118b08c0>{fire date = Monday, September 29, 2014 at 6:12:00 PM India Standard Time, time zone = Asia/Kolkata (GMT+5:30) offset 19800, repeat interval = NSWeekCalendarUnit, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = Monday, September 29, 2014 at 6:12:00 PM India Standard Time, user info = {\n 144 = mas;\n index = 63;\n userid = \"821e25e7-d76c-4328-bbba-8e367dc70c04\";\n}}",
"<UIConcreteLocalNotification: 0x118b0cc0>{fire date = Monday, September 29, 2014 at 6:12:00 PM India Standard Time, time zone = Asia/Kolkata (GMT+5:30) offset 19800, repeat interval = NSWeekCalendarUnit, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = Monday, September 29, 2014 at 6:12:00 PM India Standard Time, user info = {\n 153 = mbg;\n index = 64;\n userid = \"821e25e7-d76c-4328-bbba-8e367dc70c04\";\n}}"
)
最佳答案
您可以通过使用 [[UIApplication sharedApplication] cancelLocalNotification:(UILocalNotification *)] 或 [[UIApplication sharedApplication] cancelAllLocalNotifications] 清除之前的通知来阻止它。
您还可以在 [[UIApplication sharedApplication] scheduledLocalNotifications] 中使用带有计划通知的 NSArray。
通过这些方法,您应该能够管理您的通知。
关于ios - 如何防止 ios 中的本地通知重复?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26012515/