【发布时间】:2014-09-22 06:16:27
【问题描述】:
我的服务器上有视频,我想知道我的视频需要多长时间才能从设备中的服务器下载。这样我就可以计算下载时间并检查服务器是否很慢。任何帮助将不胜感激。
这是我的代码:
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:url] cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:[[Configuration sharedInstance] fatchTimeOut]];
[GMURLConnection sendAsynchronousRequest:request queue:self.operationQueue type:type withSubType:subType completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
//**********************Success Handling ********************
if (type == OperationTypeMeta) {
failCount = 0;
NSError *error = nil;
NSArray *serverResponse=[NSArray array];
if(data)
serverResponse = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
}];
【问题讨论】:
-
请出示您的代码
标签: ios objective-c ios7 xcode6