2015-11-18 12 views
6

Questa è una traccia di stack piuttosto stupida, perché looking around, l'unica cosa che posso pensare è che l'utente di iPhone 6s sta tentando di toccare 3D qualcosa, e il mio gesto di riconoscimento (da qualche parte, non so quale, perché non mi dice quale linea o anche quale controller) non sa come gestirlo? Non ho aggiunto alcun riconoscimento di gesti 3D-touch né sto implementando le interazioni 3D-touch ovunque.iPhone 6s - iOS 9.1 arresto anomalo su [UICollectionViewController previewingContext: viewControllerForLocation:]

Ho scelto iOS 8 in questa build e purtroppo non ho un iPhone 6s da testare, quindi non posso davvero riprodurlo.

Pensieri su cosa potrebbe causarlo, come restringere dove/cosa e come riprodurre e come gestire l'eccezione?

Thread : Fatal Exception: NSInvalidArgumentException 
0 CoreFoundation     0x18586cf48 __exceptionPreprocess 
1 libobjc.A.dylib    0x19ad17f80 objc_exception_throw 
2 CoreFoundation     0x185873b54 __CFExceptionProem 
3 UIKit       0x18b63438c -[UICollectionViewController previewingContext:viewControllerForLocation:] 
4 UIKit       0x18b187d7c -[_UIViewControllerPreviewSourceViewRecord previewInteractionController:viewControllerForPreviewingAtPosition:inView:presentingViewController:] 
5 UIKit       0x18b43cd4c -[UIPreviewInteractionController startInteractivePreviewAtLocation:inView:] 
6 UIKit       0x18b43d848 -[UIPreviewInteractionController startInteractivePreviewWithGestureRecognizer:] 
7 UIKit       0x18b43e8c0 -[UIPreviewInteractionController _handleRevealGesture:] 
8 UIKit       0x18b37b330 _UIGestureRecognizerSendTargetActions 
9 UIKit       0x18afa4b5c _UIGestureRecognizerSendActions 
10 UIKit       0x18ae3285c -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] 
11 UIKit       0x18b37c70c ___UIGestureRecognizerUpdate_block_invoke898 
12 UIKit       0x18adf18b8 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks 
13 UIKit       0x18adee63c _UIGestureRecognizerUpdate 
14 UIKit       0x18ae306cc -[UIWindow _sendGesturesForEvent:] 
15 UIKit       0x18ae2fcc8 -[UIWindow sendEvent:] 
16 UIKit       0x18ae004a4 -[UIApplication sendEvent:] 
17 UIKit       0x18adfe76c _UIApplicationHandleEventQueue 
18 CoreFoundation     0x185824544 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 
19 CoreFoundation     0x185823fd8 __CFRunLoopDoSources0 
20 CoreFoundation     0x185821cd8 __CFRunLoopRun 
21 CoreFoundation     0x185750ca0 CFRunLoopRunSpecific 
22 GraphicsServices    0x190cd4088 GSEventRunModal 
23 UIKit       0x18ae68ffc UIApplicationMain 
24 XXXXXXXXXX      0x10013739c main (main.m:16) 
25 libdyld.dylib     0x19b55a8b8 start 

risposta

5

Usi UIImagePickerController da qualche parte nella tua app? C'è un problema noto con esso e 3D Touch: UIImagePickerController crashing on force touch?

Il contatto forzato di una foto in UIImagePickerController sembra bloccare qualsiasi app. Immagino che dovremo aspettare fino a quando Apple non risolverà questo problema.

+0

Yup, la mia ricerca ha portato alla stessa conclusione. – brandonscript

+0

La mia risposta originale aveva un collegamento a questa stessa domanda, scusa :) Li ho confusi nel mio cartone ... Risolto ora! – Argentumko

+0

Oh, aspetta, hai effettivamente quel link nella tua domanda e non me ne sono accorto. Questo è imbarazzante! Credo di aver appena confermato che sto avendo lo stesso problema ¯ \\ _ (ツ) _/¯ – Argentumko

6

PUPhotoGridViewController (utilizzato in UIImagePickerController) è un semplice UICollectionViewController ed è possibile scrivere l'estensione per il metodo non implementato.

extension UICollectionViewController: UIViewControllerPreviewingDelegate { 
    public func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { 
     return nil; 
    } 

    public func previewingContext(previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) { 

    } 
} 
+0

E anche Obj-C? – brandonscript

3

Grazie per @Antigp'answer!

Ecco la versione OC:

Header

@interface UICollectionViewController (FixCrash) <UIViewControllerPreviewingDelegate> 
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location; 
- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext 
    commitViewController:(UIViewController *)viewControllerToCommit; 
@end 

Attuazione

@implementation UICollectionViewController (FixCrash) 
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location { 
    return nil; 
} 
- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext 
     commitViewController:(UIViewController *)viewControllerToCommit { 
    return; 
} 
@end 
Problemi correlati