Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的应用程序中创建 UILocalNotifications,我想在每次通过通知时显示不同的字符串。问题是它第一次选择随机字符串,之后每次都显示相同的字符串。任何人都知道如何每次从 5 - 6 个字符串列表中显示随机字符串?
只有一种解决方法 - 使用不同(随机)字符串安排多个通知。
显然,您将无法使用重复,因此您只能计划有限的未来时间(限制为 64 条通知)。通常这不是一个大问题,如果您在每次打开应用程序时重新安排通知并且最后一个通知类似于“您有一段时间没有访问 MY_APPLICATION,您将不会再收到通知”。