ios - timeInterval 后的 WebService 调用

标签 ios objective-c iphone ios8

我想每 6 小时调用一次 Web 服务。我是 iOS 新手。请帮助任何帮助将不胜感激。我被困住了。

最佳答案

您可以使用 NSTimer 并将其安排 6 小时

        NSTimer *timer = nil;
        timer = [NSTimer scheduledTimerWithTimeInterval:6*60*60 //6 hour
                                                          target:self
                                                        selector:@selector(performAction)
                                                        userInfo:nil
                                                         repeats:YES];

关于ios - timeInterval 后的 WebService 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33076883/

相关文章:

iphone - 获取iPhone的IP地址

c# - Xamarin iOS Sleep UI线程不起作用

ios - 递减整数 Spritekit

iphone - editButtonItem 设置但没有减号按钮?

iphone - iPhone 上 SQLite 数据库的光保护

iphone - 如何在我的所有 View 底部添加通用 UIButton 而不是 iPhone 中的 tabsview Controller ?

ios - 在 iOS 中使用 JSON 创建动态表单 UI

iphone - iOS 滑动手势滚动效果

ios - 访问 2 个 viewController

ios - 如何在ios中的谷歌地图中添加倾斜效果?