We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问下COSequence 这个类是自己封装的吗? 内部是使用COCoroutine 生成器去实现批量下载的吗? 而且demo 中 使用
COSequence
COCoroutine
COCoroutine *co1 = xx [co1 next]
next 方法no found
The text was updated successfully, but these errors were encountered:
现在是 COGenerator
Sorry, something went wrong.
@NianJi 在调用 COProgressPromise 为什么一直打印 test 我使用的是实例的代码
COProgressPromise
test
static COProgressPromise* progressDownloadFileFromUrl(NSString *url){ COProgressPromise *promise = [COProgressPromise promise]; [NSURLSession sharedSession].configuration.requestCachePolicy = NSURLRequestReloadIgnoringCacheData; NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:url] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (error) { [promise reject:error]; } else{ [promise fulfill:data]; } }]; [task resume]; // setup progress [promise setupWithProgress:task.progress]; return promise; } co_launch(^{ COProgressPromise *promise = progressDownloadFileFromUrl(@"http://img17.3lian.com/d/file/201701/17/9a0d018ba683b9cbdcc5a7267b90891c.jpg"); for(id p in promise){ double v = [p doubleValue]; NSLog(@"current progress: %f", (float)v); } // get the download result NSData *data = await(promise); // handle data });
而且运行的时候这句会报错,得注释掉才可以
NSData *data = await(promise);
No branches or pull requests
请问下
COSequence
这个类是自己封装的吗?内部是使用
COCoroutine
生成器去实现批量下载的吗?而且demo 中 使用
COCoroutine *co1 = xx [co1 next]
next 方法no found
The text was updated successfully, but these errors were encountered: