2015-10-05 102 views
0

我使用QLPreviewController來預覽圖像和pdf文件。它適用於iOS7-9。然而,當我點擊設備上分享按鈕與iOS9,應用程序崩潰,立即與以下情況除外:共享iOS上的QLPreviewController崩潰9

Fatal Exception: NSInvalidArgumentException *** -[__NSCFString rangeOfString:options:range:locale:]: nil argument 

這並不與iOS9模擬器發生。我可以在iOS7 & 8的設備上看到AirDrop共享菜單,但在說明的頂部會顯示奇怪的(null)標題。這裏是鏈接到樣本屏幕截圖與iOS7的iPhone 5拍攝:

enter image description here

有任何你遇到過這樣的問題?

完整堆棧跟蹤從CrashLytics

Thread : Fatal Exception: NSInvalidArgumentException 
0 CoreFoundation     0x00000001860a0f5c __exceptionPreprocess + 124 
1 libobjc.A.dylib    0x000000019ac97f80 objc_exception_throw + 56 
2 CoreFoundation     0x00000001860a0ea4 -[NSException initWithCoder:] 
3 Foundation      0x0000000186efe598 -[NSString rangeOfString:options:range:locale:] + 348 
4 Sharing      0x0000000195064118 -[SFAirDropActivityViewController attributedStringWithTitle:content:] 
5 Sharing      0x00000001950633e0 -[SFAirDropActivityViewController viewDidLoad] 
6 UIKit       0x000000018b5f7610 -[UIViewController loadViewIfRequired] + 1124 
7 UIKit       0x000000018b5f7194 -[UIViewController view] + 28 
8 UIKit       0x000000018bf3a244 __79-[_UIActivityGroupListViewController updateVisibleActivityGroupViewControllers]_block_invoke115 + 112 
9 CoreFoundation     0x0000000185f9e6f0 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 100 
10 CoreFoundation     0x0000000185f95418 -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 148 
11 UIKit       0x000000018bf39e90 -[_UIActivityGroupListViewController updateVisibleActivityGroupViewControllers] + 456 
12 UIKit       0x000000018bf3a754 -[_UIActivityGroupListViewController viewDidLoad] + 720 
13 UIKit       0x000000018b5f7610 -[UIViewController loadViewIfRequired] + 1124 
14 UIKit       0x000000018b5f7194 -[UIViewController view] + 28 
15 UIKit       0x000000018ba4901c -[UIAlertController setContentViewController:] + 284 
16 UIKit       0x000000018b7f0278 -[UIActivityViewController viewDidLoad] + 1280 
17 UIKit       0x000000018b5f7610 -[UIViewController loadViewIfRequired] + 1124 
18 UIKit       0x000000018b5f7194 -[UIViewController view] + 28 
19 UIKit       0x000000018b969bfc -[UIViewController _setPresentationController:] + 108 
20 UIKit       0x000000018b962e58 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1328 
21 UIKit       0x000000018b964840 -[UIViewController _presentViewController:withAnimationController:completion:] + 4428 
22 UIKit       0x000000018b967278 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 472 
23 UIKit       0x000000018b6ee0a4 -[UIViewController presentViewController:animated:completion:] + 184 
24 UIKit       0x000000018bc48c84 _UIDocumentInteractionControllerPresentPopoverFromItemOrShowActivityViewController + 356 
25 UIKit       0x000000018bc48a70 -[UIDocumentInteractionController presentOptionsMenuFromBarButtonItem:animated:] + 264 
26 QuickLook      0x000000018af9d220 -[QLPreviewController actionButtonTapped:] + 220 
27 UIKit       0x000000018b62e3c8 -[UIApplication sendAction:to:from:forEvent:] + 100 
28 UIKit       0x000000018b7ad3dc -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 168 
29 UIKit       0x000000018b62e3c8 -[UIApplication sendAction:to:from:forEvent:] + 100 
30 UIKit       0x000000018b62e344 -[UIControl sendAction:to:forEvent:] + 80 
31 UIKit       0x000000018b616c6c -[UIControl _sendActionsForEvents:withEvent:] + 416 
32 UIKit       0x000000018b616db8 -[UIControl _sendActionsForEvents:withEvent:] + 748 
33 UIKit       0x000000018b62dc5c -[UIControl touchesEnded:withEvent:] + 572 
34 UIKit       0x000000018b62d88c -[UIWindow _sendTouchesForEvent:] + 804 
35 UIKit       0x000000018b626ac0 -[UIWindow sendEvent:] + 784 
36 UIKit       0x000000018b5f7a10 -[UIApplication sendEvent:] + 248 
37 UIKit       0x000000018b5f5efc _UIApplicationHandleEventQueue + 5348 
38 CoreFoundation     0x00000001860585a4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 
39 CoreFoundation     0x0000000186058038 __CFRunLoopDoSources0 + 540 
40 CoreFoundation     0x0000000186055d38 __CFRunLoopRun + 724 
41 CoreFoundation     0x0000000185f84dc0 CFRunLoopRunSpecific + 384 
42 GraphicsServices    0x00000001910d8088 GSEventRunModal + 180 
43 UIKit       0x000000018b65ef44 UIApplicationMain + 204 
+0

任何修復,可以幫助我? – Rajesh

+0

檢查iOS 9.2 beta 3或更高版本上您是否仍然存在問題。 – JohnnyFloyd

+0

嗨,你有沒有解決這個問題。我面臨同樣的問題。 – Kittu

回答

1

我遇到了同樣的問題。 我的解決方案是,對SFAirDropActivityViewController執行一些操作。

代碼:

@interface SFAirDropActivityViewController : UIViewController 
+ (BOOL)isAirDropAvailable; 
@end 


@implementation SFAirDropActivityViewController 
+ (BOOL)isAirDropAvailable{ 
return NO; 
} 
@end 

PrivateFrameworks地址:

https://github.com/nst/iOS-Runtime-Headers/blob/master/PrivateFrameworks/Sharing.framework/SFAirDropActivityViewController.h

+0

這工作..但不知道,如果蘋果批准它.. – Rajesh