我目前有一些需要运行CFRunLoopRun()的代码。
这将无限期运行。我想用只运行一段时间的东西来代替它,比如30秒。
我尝试过CFRunLoopRunInMode(),但它立即退出。
CFRunLoopRun(); // Works but never stops, I need to stop after 30s
CFStringRef mode = (__bridge CFStringRef)@"mode";
CFTimeInterval timeInterval = 10.0;
CFRunLoopRunInMode(mode, timeInterval, FALSE); // Doesn't work, syntax is wrong?, stops immediatelyhttps://stackoverflow.com/questions/44556883
复制相似问题