Post not yet marked as solved
When two apps have the same teamid, I get a nil souceAppliacation in release from https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionssourceapplicationkey?language=objc, but can get a bundleid in debug,
Post not yet marked as solved
hello,i want to caculate the time it takes get the image from io util render to UIImageView ,my code like this:NSDate *ad = [NSDate date];
NSData *data = [NSData dataWithContentsOfFile:downloadURL.relativePath];
CFDataRef dataRef = (__bridge CFDataRef)data;
CGImageSourceRef source =CGImageSourceCreateWithData(dataRef, nil);
CGImageRef cgImage =CGImageSourceCreateImageAtIndex(source, 0, nil);
CFDataRef rawData =CGDataProviderCopyData(CGImageGetDataProvider(cgImage));
NSDate *bd = [NSDate date];
NSLog(@"time dis :%f",[bd timeIntervalSinceDate:ad]);but i find that large image always take longer than small image,i can't understand ,can you give me some advice
Post not yet marked as solved
hi,I have some question when I upload 50 video (about 1GB) at a time from the gallery,It crashed frequently in iphone 6s 11.2.6 16Gbut it didn't happen on iPhone 6s 32G and iphone 7p 32G,and Xcode didn’t output anything crash informationbut i got some information from Mac console like thisEXC_RESOURCE -> QCloudCOSBrowser[6180] exceeded mem limit: ActiveHard 1400 MB (fatal)
83826.914 memorystatus: killing_specific_process pid 6180 [QCloudCOSBrowser] (per-process-limit 10) - memorystatus_available_pages: 71this is my codefor (int i = 0; i < assets.count; i++) {
@autoreleasepool {
PHAsset *asset = assets[i];
if (asset.mediaType == PHAssetMediaTypeVideo) {
[[TZImageManager manager] getVideoWithAsset:asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
if (info[@"PHImageFileSandboxExtensionTokenKey"]) {
NSArray *tmpArray = [info[@"PHImageFileSandboxExtensionTokenKey"] componentsSeparatedByString:@";"];
NSString *filePathStr = [tmpArray[tmpArray.count - 1]substringFromIndex:9];
NSString* fileName = [asset valueForKey:@"filename"];
NSArray *array = [fileName componentsSeparatedByString:@"."];
NSString* tempFile = QCloudDocumentsTempFile(array[0], array[1]);
NSData *videoData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:filePathStr]];
[[CBFileManager shareInstance] writeFileAsync:tempFile data:videoData complete:^(BOOL result) {
if (result) {
}
}];
}else if([info objectForKey:@"PHImageResultIsInCloudKey"]){
PHVideoRequestOptions* options = [[PHVideoRequestOptions alloc] init];
options.version = PHVideoRequestOptionsVersionOriginal;
options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
options.networkAccessAllowed = YES;
[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset* avasset, AVAudioMix* audioMix, NSDictionary* info){
AVURLAsset *videoAsset = (AVURLAsset*)avasset;
NSString *filePathStr = videoAsset.URL.relativePath;
NSString* fileName = [asset valueForKey:@"filename"];
NSArray *array = [fileName componentsSeparatedByString:@"."];
NSString* tempFile = QCloudDocumentsTempFile(array[0], array[1]);
NSData *videoData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:filePathStr]];
[[CBFileManager shareInstance] writeFileAsync:tempFile data:videoData complete:^(BOOL result) {
if (result) {
}
}];
}];
}
}];
}
}
}Looking forward to your reply
Post not yet marked as solved
hi,I have some question when i use background session to uploadif i upload a big file with backgroundConfiguration and make the app into background ,the example1 delegate method will be called back like thisexample1applicationDidEnterBackground
bytesSent: 32768, totoalBytesSent 11960320 ,totalBytesExpectedToSend: 52428800
bytesSent: 32768, totoalBytesSent 11993088 ,totalBytesExpectedToSend: 52428800
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3335 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:everything is okexample2:but when i use multitasking upload,i will add them to an operationArray and i will take five tasks from the queue,when a task have completed and i will take a new task from operationArray to resume ,the delegate method will be called back linke thisapplicationDidEnterBackground
bytesSent: 32768, totoalBytesSent 3211264 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 4947968 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3363 URLSession:task:didCompleteWithError:
request = 3361 URLSession:task:didCompleteWithError:
request = 3365 URLSession:task:didCompleteWithError:
[task][3367]take task[3367] from array
request = 3362 URLSession:task:didCompleteWithError:
request = 3366 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:
[task][3368]take task [3368] from array
[task][3369]take task[3369] from array
[task][3364]take task[3364] from array
[task][3370]take task[3370] from array
bytesSent: 32768, totoalBytesSent 32768 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 1638400 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3367 URLSession:task:didCompleteWithError:
request = 3368 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:
bytesSent: 32768, totoalBytesSent 32768 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 1802240 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
request = 3370 URLSession:task:didCompleteWithError:
request = 3369 URLSession:task:didCompleteWithError:
request = 3364 URLSession:task:didCompleteWithError:
URLSessionDidFinishEventsForBackgroundURLSession:the example2 is different from example1 is that example2 have progress calll back ,should it have progress call back when a task was completed in background?there are alse have some strange logs , the URLSession:task:didCompleteWithError will called back after URLSessionDidFinishEventsForBackgroundURLSession: like this:[task][3339]take task from array
applicationDidEnterBackground
bytesSent: 32768, totoalBytesSent 32768 ,totalBytesExpectedToSend: 5242880
...
bytesSent: 32768, totoalBytesSent 1998848 ,totalBytesExpectedToSend: 5242880
application:handleEventsForBackgroundURLSession:completionHandler:
URLSessionDidFinishEventsForBackgroundURLSession:
request = 3339 URLSession:task:didCompleteWithError: