首页 > 代码库 > ios 开启线程定时请求某个方法

ios 开启线程定时请求某个方法


- (void)startLoop

{

        [NSThreaddetachNewThreadSelector:@selector(loopMethod)toTarget:selfwithObject:nil];

}


- (void)loopMethod

{

    [NSTimerscheduledTimerWithTimeInterval:3.0ftarget:selfselector:@selector(requestIsHaveReview)userInfo:nilrepeats:YES];

    NSRunLoop *loop = [NSRunLoopcurrentRunLoop];

    [loop run];

}