几分钟隔几分钟发送请求循环

//每隔五分钟发送ping
//- (void)handleNormalThreadButtonTouchUpInside
//{
// NSLog(@"Enter handleNormalThreadButtonTouchUpInside");
//
//
// NSLog(@"Start a New Normal Thread");
// NSThread *normalThread = [[NSThread alloc] initWithTarget:self selector:@selector(handleNormalThreadTask) object:nil];
// [normalThread start];
//
// //等待线程完成再执行以下任务,在这种情况下会阻塞UI线程
//// while (!self.normalThreadDidFinishFlag) {
// [NSThread sleepForTimeInterval:0.5];
//// }
//
// //直到线程执行完成,才会打印handleNormalButtonTouchUpInside中的输出信息
// NSLog(@"Exit handleNormalThreadButtonTouchUpInside");
//}
//-(void)handleNormalThreadTask{
//
// while (1) {
// NSLog(@"请求");
// NSMutableDictionary *mDict = [NSMutableDictionary dictionary];
// mDict[@"dwID"] = [DWUserInfo sharedDWUserInfo].dwID;
// mDict[@"info"] = @"";
// NSLog(@"id%@",[DWUserInfo sharedDWUserInfo].dwID);
// [DWHttpTool post:ping params:mDict success:^(id json) {
// NSLog(@"ping = %@", json);
//
// NSLog(@"循环请求");
//
// } failure:^(NSError *error) {
// [MBProgressHUD showError:@"在线请求错误"];
// }];
// sleep(300);
//
// }
//
//
//
//}

你可能感兴趣的:(几分钟隔几分钟发送请求循环)