两个数组iphone sdk的离线比较
我有两个包含字符串变量的数组。在一个数组中,它包含来自 Web 服务的值,每 5 秒更新一次。因此,我需要离线运行此应用程序,并将该数组与另一个包含一些示例值的数组进行比较。如果发生任何匹配,应生成推送通知。这可能吗?如果是的话我该如何实施?如果不行的话还有其他办法吗?
请帮忙... 谢谢....
I have two arrays containing string variables. In one array, it contains the values from a web service, it will be updating in every 5 seconds. So, i need to run this app offline and also compare the array with another array that contains some sample values. If any matches occur, should generate a PushNotification. Is that possible?? If yes how can I implement that? If no, is there any other way?
Please help...
Thanks....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嘿,我可以给你一个想法。
将您的应用程序注册为后台应用程序
在进入后台时创建一个后台处理程序,您将获得大约 10 分钟的时间来完成任务,时间结束后,处理程序将调用完成块,并在此块中再次创建后台处理程序,您将再次获得 10 分钟的时间,依此类推,这样您的应用程序就会在后台运行。但要注意看门狗。
PS这只是一个想法,我不知道苹果对此有何看法。希望你会成功。
Hey I can just give you an idea.
register your app for background app
in did enter background make a background handler and you will get approximately 10 mins to finish the task, after the time is over the handler will call finishing block and in this block again create the background handler you will get again 10 mins and so on, in this way your application will reamin in background. But be aware of watchdog.
P.S. This is just an idea, i dont know the apple's view on this. Hope you will succeed.