Utilizzo di CritterCism con alcuni beta tester Sto vedendo apparire un errore più volte che non ho mai sperimentato me stesso e non riesco a replicare.NSInternalInconsistencyException accesso a _cachedSystemAnimationFence richiede il thread principale
Crittercism mi dice: NSInternalInconsistencyException accesso _cachedSystemAnimationFence presupponga il thread principale
E la linea che sta puntando è:
[picker dismissViewControllerAnimated:YES completion:^{
Facendo qualche lettura sulla StackOverflow sembra che tutto il codice di interfaccia utente dovrebbe essere riceve un il thread principale. L'errore che sto riscontrando è stato eseguito su un thread in background per respingereViewControllerAnimated?
Curioso perché questo errore è relativamente casuale (ad esempio non riesco a riprodurlo) e anche come lo risolvo.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
__block PHObjectPlaceholder *assetPlaceholder;
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:[info objectForKey:@"UIImagePickerControllerOriginalImage"]];
assetPlaceholder = changeRequest.placeholderForCreatedAsset;
} completionHandler:^(BOOL success, NSError *error) {
NSArray *photos = [[NSArray alloc] initWithObjects:assetPlaceholder.localIdentifier, nil];
PHFetchResult *savedPhotos = [PHAsset fetchAssetsWithLocalIdentifiers:photos options:nil];
[savedPhotos enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL *stop) {
NSMutableArray *images = self.event.eventAttachments;
if (images) {
[images addObject:asset];
} else {
images = [[NSMutableArray alloc]init];
[images addObject:asset];
}
self.event.eventAttachments = images;
[picker dismissViewControllerAnimated:YES completion:^{
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:4];
NSArray *indexPaths = [[NSArray alloc] initWithObjects:indexPath, nil];
[self.tblChildrenNotes beginUpdates];
[self.tblChildrenNotes reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
[self.tblChildrenNotes endUpdates];
}];
}];
}];
}
Hai mai risolto questo problema? O qualche soluzione che puoi offrire? –
È necessario il codice che sta tentando di manipolare l'interfaccia utente su un thread in background. Avvia la manipolazione dell'interfaccia utente nello snippet di codice che l'utente "iOS" ha pubblicato sopra – jungledev