0
自iOS 10更新以來,我目前遇到了iOS應用程序的新問題。這個問題只發生在iOS 10及以上版本的設備上。完整的崩潰日誌如下:AVWeakReferencingDelegateStorage:委託序列化隊列
Crashed: <AVWeakReferencingDelegateStorage: 0x170229fc0> delegate serialization queue
0 libdispatch.dylib 0x18f8121e8 _os_object_retain + 72
1 libdispatch.dylib 0x18f8111c0 _dispatch_client_callout + 16
2 libdispatch.dylib 0x18f822584 _dispatch_non_barrier_sync_f_invoke + 84
3 AVFoundation 0x1980e33ec -[AVWeakReferencingDelegateStorage getRetainedDelegate:retainedDelegateQueue:] + 168
4 AVFoundation 0x1980e3240 -[AVWeakReferencingDelegateStorage delegate] + 36
5 AVFoundation 0x1980ce244 -[AVCaptureVideoDataOutput _handleRemoteQueueOperation:] + 76
6 AVFoundation 0x1980ce168 __47-[AVCaptureVideoDataOutput _updateRemoteQueue:]_block_invoke + 100
7 CoreMedia 0x1932a0da8 __FigRemoteOperationReceiverCreateMessageReceiver_block_invoke + 260
8 CoreMedia 0x1932c0020 __FigRemoteQueueReceiverSetHandler_block_invoke.2 + 216
9 libdispatch.dylib 0x18f8111c0 _dispatch_client_callout + 16
10 libdispatch.dylib 0x18f81e008 _dispatch_continuation_pop + 576
11 libdispatch.dylib 0x18f82a648 _dispatch_source_latch_and_call + 204
12 libdispatch.dylib 0x18f813164 _dispatch_source_invoke + 820
13 libdispatch.dylib 0x18f81f278 _dispatch_queue_serial_drain + 468
14 libdispatch.dylib 0x18f8149a8 _dispatch_queue_invoke + 652
15 libdispatch.dylib 0x18f81f278 _dispatch_queue_serial_drain + 468
16 libdispatch.dylib 0x18f8149a8 _dispatch_queue_invoke + 652
17 libdispatch.dylib 0x18f8202ac _dispatch_root_queue_drain_deferred_item + 248
18 libdispatch.dylib 0x18f826b0c _dispatch_kevent_worker_thread + 816
19 libsystem_pthread.dylib 0x18fa19174 _pthread_wqthread + 948
20 libsystem_pthread.dylib 0x18fa18db4 start_wqthread + 4
我在代碼中找到確切位置的代碼崩潰,但現在我知道是什麼原因造成它與iOS 10. 附註:在設備上崩潰它不會在所有iOS 10+設備上崩潰。
的代碼如下:
- (void)forwardToResultsVC:(NSDictionary *)results
{
self.successfulTestResults = results;
NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread];
[self.petTest updateTestWithTestElementParameters:results];
[localContext MR_saveOnlySelfAndWait];
[self performSegueWithIdentifier:kTestAnalyzeSeguge sender:nil];
// Log successful test and time it took to take (Parse)
NSDate *testCompleteDate = [NSDate date];
NSTimeInterval timeToTakeTest = [testCompleteDate timeIntervalSinceDate:self.testStartDate];
NSDictionary *params = @{ kPetnosticsAnalyticsTimeToTakeSuccesfulTest : [NSString stringWithFormat:@"%f", timeToTakeTest]};
[PFAnalytics trackEvent:kPetnosticsAnalyticsTestSuccesfullyCompleted dimensions:params];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:kTestResultsSeguge]) {
SPResultsViewController *resultsVC = segue.destinationViewController;
resultsVC.test = self.petTest;
resultsVC.ogHarrisFoundPointsImage = self.ogHarrisFoundPointsImage;
resultsVC.foundTestPointsImage = self.foundTestPointsImage;
resultsVC.analysisImage = self.analysisImage;
resultsVC.croppedStripImage = self.croppedStripImage;
resultsVC.test = self.petTest;
} else if ([segue.identifier isEqualToString:kTestAnalyzeSeguge]) {
SPAnalyzingViewController *analyzingVC = segue.destinationViewController;
analyzingVC.pet = self.pet;
analyzingVC.test = self.petTest;
analyzingVC.ogHarrisFoundPointsImage = self.ogHarrisFoundPointsImage;
analyzingVC.foundTestPointsImage = self.foundTestPointsImage;
analyzingVC.analysisImage = self.analysisImage;
analyzingVC.croppedStripImage = self.croppedStripImage;
analyzingVC.backingCard = self.backingCard;
if (self.testMethod == nil) {
self.testMethod = @"Cup";
}
analyzingVC.testMethod = self.testMethod;
}
}
的賽格瑞然後提示如下:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self saveTestUploadImage];
}
- (void)saveTestUploadImage
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
UIImage *debugImage = self.foundTestPointsImage;
NSData *testImageData = nil;
if (debugImage) {
[debugImage saveImageTofileName:@"testImage.jpg"];
testImageData = UIImageJPEGRepresentation(debugImage, 1);
}
if ([testImageData length] > 0) {
PFFile *imageFile = [PFFile fileWithName:@"testImage.jpg" data:testImageData];
[self uploadTestDataWithImage:imageFile];
} else {
// No Test Image Data... hmm...
[PFAnalytics trackEvent:@"SPTestNoImageFound"];
[self uploadTestDataWithImage:nil];
}
});
}
然而,它崩潰被稱爲前saveTestUploadImage。 任何想法?先進的謝謝你。
這是一個非常好的猜測。我們必須找出類似的問題,我們驚訝地發現,這是因爲我們沒有在plist中指定一個** Privacy:**字符串。 – NRitH
感謝您的貢獻。不幸的是,由於它不會在所有iOS10設備上發生,並且不會每次都發生(它來來去去),所以我無法測試這個理論。該應用在應用商店的iOS 10更新之前發佈。在iOS 10之前,隱私是自動處理的,你認爲新的iOS會將自己與舊應用混淆嗎? –
在我的情況下,應用程序總是崩潰在ios10設備上的新安裝。我很確定它沒有在iOS10更新之前安裝並啓動應用程序的設備上崩潰。 – SeNeO