Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11747] iOS 6: Titanium.UI.iPad.DocumentViewer crashes when tapping done button

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-03-26T21:16:16.000+0000
Affected Version/sRelease 2.1.3, Release 3.0.0
Fix Version/sRelease 3.1.0, 2013 Sprint 07 Core, 2013 Sprint 07
ComponentsiOS
Labelstriage
ReporterTony Lewis
AssigneeMax Stepanov
Created2012-10-29T15:26:29.000+0000
Updated2013-04-06T10:05:59.000+0000

Description

*Problem description* After creating and showing Titanium.UI.iPad.DocumentViewer, tapping done button between 2-4 times crashes the app. *Note* - Tested and confirmed on iOS 6, TiSDK 2.1.3 GA and latest 3.0.0. - Does not crash on iOS 5.1, TiSDK 2.1.3 GA *Log generated by 3.0.0*
[INFO] DocumentViewer/1.0 (3.0.0.v20121112140159.b7beec5)
[WARN] Titanium.UI.iPad.createDocumentViewer DEPRECATED in 2.1.1: REMOVED in Ti.Ui.iOS.createDocumentViewer()
[WARN] Titanium.UI.iPad.createDocumentViewer DEPRECATED in 2.1.1: REMOVED in Ti.Ui.iOS.createDocumentViewer()
[WARN] Titanium.UI.iPad.createDocumentViewer DEPRECATED in 2.1.1: REMOVED in Ti.Ui.iOS.createDocumentViewer()
[WARN] Titanium.UI.iPad.createDocumentViewer DEPRECATED in 2.1.1: REMOVED in Ti.Ui.iOS.createDocumentViewer()
2012-11-12 15:14:16.382 DocumentViewer[22493:1b203] -[__NSMallocBlock__ documentInteractionControllerDidEndPreview:]: unrecognized selector sent to instance 0xb26cbe0
[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
Reason:
-[__NSMallocBlock__ documentInteractionControllerDidEndPreview:]: unrecognized selector sent to instance 0xb26cbe0
Stack trace:
0   CoreFoundation                      0x03552012 __exceptionPreprocess + 178
1   libobjc.A.dylib                     0x02fa4e7e objc_exception_throw + 44
2   CoreFoundation                      0x035dd4bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 253
3   CoreFoundation                      0x03541bbc ___forwarding___ + 588
4   CoreFoundation                      0x0354194e _CF_forwarding_prep_0 + 14
5   UIKit                               0x00f523f7 -[UIDocumentInteractionController(QLPreviewController) previewControllerDidDismiss:] + 97
6   QuickLook                           0x096c365d -[QLPreviewController viewDidDisappear:] + 397
7   UIKit                               0x00c81753 -[UIViewController _setViewAppearState:isAnimating:] + 146
8   UIKit                               0x00c81c62 -[UIViewController __viewDidDisappear:] + 157
9   UIKit                               0x00c81d54 -[UIViewController _endAppearanceTransition:] + 235
10  UIKit                               0x00c8f5c9 -[UIViewController(UIContainerViewControllerProtectedMethods) endAppearanceTransition] + 41
11  UIKit                               0x00e8c882 -[UIWindowController transitionViewDidComplete:fromView:toView:removeFromView:] + 1940
12  UIKit                               0x00c5e594 -[UITransitionView notifyDidCompleteTransition:] + 520
13  UIKit                               0x00c5e21c -[UITransitionView _didCompleteTransition:] + 1297
14  UIKit                               0x00c60563 -[UITransitionView _transitionDidStop:finished:] + 107
15  UIKit                               0x00bdc3b6 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 237
16  UIKit                               0x00bdc554 -[UIViewAnimationState animationDidStop:finished:] + 68
17  QuartzCore                          0x021527d8 _ZN2CA5Layer23run_animation_callbacksEPv + 284
18  libdispatch.dylib                   0x03874014 _dispatch_client_callout + 14
19  libdispatch.dylib                   0x038647d5 _dispatch_main_queue_callback_4CF + 296
20  CoreFoundation                      0x034f8af5 __CFRunLoopRun + 1925
21  CoreFoundation                      0x034f7f44 CFRunLoopRunSpecific + 276
22  CoreFoundation                      0x034f7e1b CFRunLoopRunInMode + 123
23  GraphicsServices                    0x0326a7e3 GSEventRunModal + 88
24  GraphicsServices                    0x0326a668 GSEventRun + 104
25  UIKit                               0x00b9e65c UIApplicationMain + 1211
26  DocumentViewer                      0x00006518 main + 456
27  DocumentViewer                      0x00002e05 start + 53
2012-11-12 15:14:16.559 DocumentViewer[22493:1b203] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSMallocBlock__ documentInteractionControllerDidEndPreview:]: unrecognized selector sent to instance 0xb26cbe0'
*** First throw call stack:
(0x3552012 0x2fa4e7e 0x35dd4bd 0x3541bbc 0x354194e 0xf523f7 0x96c365d 0xc81753 0xc81c62 0xc81d54 0xc8f5c9 0xe8c882 0xc5e594 0xc5e21c 0xc60563 0xbdc3b6 0xbdc554 0x21527d8 0x3874014 0x38647d5 0x34f8af5 0x34f7f44 0x34f7e1b 0x326a7e3 0x326a668 0xb9e65c 0x6518 0x2e05)
[INFO] Application has exited from Simulator

Attachments

FileDateSize
DocumentViewer.zip2012-11-12T16:41:25.000+00004247421

Comments

  1. Daniel Sefton 2012-11-09

    Can you provide a reproducible test case in the form of an app.js? Thanks.
  2. Tony Lewis 2012-11-12

    Sample app has been uploaded.
  3. Daniel Sefton 2012-11-12

    Thanks Tony. So I confirmed this with iOS 6, TiSDK 2.1.3 GA and latest 3.0.0 on both device (iPad 3) and simulator. It crashes when tapping 'Done' between 2-4 times. I tested it on iOS 5.1, TiSDK 2.1.3 GA and it does not crash. When running it with 3.0.0 I got an extensive log about what the error actually is. I will add it to the description. I will now move this to TiMob for engineering to take a look.
  4. Daniel Mahon 2013-01-10

    +1 Same issue with studio and sdk @ latest release on iOS 6
  5. Alberto Gonzalez 2013-02-14

    +1 I have an app that uses DocumentViewer and it keeps crashing.
  6. Max Stepanov 2013-03-25

    Simplified test instructions: 1. Launch the attached app on 6.0 iPad Simulator 2. Press "View Document" 3. Simulate memory warning 4. Press "Done" button or wait 5 seconds to get it closed with timeout set.
  7. Max Stepanov 2013-03-25

    Test case:
       var win = Titanium.UI.createWindow({
       		title:'Window',
           	backgroundColor:'#fff',
       		className:'navBarColor',
       		translucent:false
       	});
       	
       var scrollingView = Ti.UI.createScrollView({
       		top:0,
       		left:0,
       		right:0,
       		bottom:0
       	});
       	win.add(scrollingView);
       	
       var docButton = Titanium.UI.createButton({
       		top: 10,
       		right:10,
       		height:30,
       		width: 200,
       		style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,
       		title:'View Document'
       	});
       	scrollingView.add(docButton);
       	
       var displayProposal = function() {
       			var downloadDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'');
       			var downloadFile = Titanium.Filesystem.getFile(downloadDir.nativePath,'doc.pdf');
       			var downloadFilePath = downloadFile.nativePath;
       	 		var docViewer = Titanium.UI.iPad.createDocumentViewer({url:'doc.pdf'});
       			docViewer.show();
       			setTimeout(function(){
       				docViewer.hide();
       			},5000);
       	}
       docButton.addEventListener('click', function(e) {
       			displayProposal();
       	});
       
       win.open();
       
       
  8. Max Stepanov 2013-03-25

    PR https://github.com/appcelerator/titanium_mobile/pull/4030
  9. Paras Mishra 2013-04-06

    Tapping done button, Titanium.UI.iPad.DocumentViewer doesn't crashes. Verified on: Device : iPad mini, iOS version: 6+ SDK: 3.1.0.v20130405170202 CLI version : 3.1.0-beta OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201304011603 XCode : 4.5.1

JSON Source