Using Photos framework App Crashes when user denies access and view controller is dismissed
| Originator: | arnold.nefkens | ||
| Number: | rdar://22376207 | Date Originated: | 21-08-2015 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 8.4 |
| Classification: | Crash | Reproducible: | Always |
Summary: In the case that the user does not give permission to access the Photos framework, and the uses dismisses the view controller in which the permission was requested, the app crashes. Steps to Reproduce: 1: on the ViewWillAppear, we call: PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus]; 2: The user denies access, on the status return block on the status case PHAuthorizationStatusDenied: we dismiss the view controller using [self.navigationController dismissViewControllerAnimated:YES completion:nil]; 3: App Crashes Expected Results: App does not crash. Actual Results: App Crash, below the stack trace. 2015-08-21 09:57:16.446 <redacted>[93092:14603781] *** This application is not allowed to access Photo data. ( 0 PhotoLibraryServices 0x000000010a0a5cb3 -[PLPhotoLibrary initWithTransientContext:name:] + 642 1 Photos 0x0000000104fb35a4 __30-[PHPhotoLibrary photoLibrary]_block_invoke + 59 2 libdispatch.dylib 0x0000000108c14614 _dispatch_client_callout + 8 3 libdispatch.dylib 0x0000000108c00881 dispatch_once_f + 565 4 Photos 0x0000000104fb3563 -[PHPhotoLibrary photoLibrary] + 140 5 Photos 0x0000000104f88af2 -[PHCoreImageManager _cancelAndFlushPreheatItemsForAssets:CPLPrefetching:domain:operation:passingTestHandler:didCancelHandler:] + 178 6 Photos 0x0000000104fa26cf -[PHImageManager dealloc] + 176 7 libobjc.A.dylib 0x0000000107ecc28e _ZN11objc_object17sidetable_releaseEb + 236 8 <redacted> 0x0000000104aeef3a -[ViewController .cxx_destruct] + 106 9 libobjc.A.dylib 0x0000000107eb6448 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127 10 libobjc.A.dylib 0x0000000107ec49b1 objc_destructInstance + 96 11 libobjc.A.dylib 0x0000000107ec49e4 object_dispose + 22 12 UIKit 0x0000000106d6df4a -[UIResponder dealloc] + 90 13 UIKit 0x0000000106d19398 -[UIViewController dealloc] + 1891 14 CoreFoundation 0x00000001085148eb CFRelease + 603 15 CoreFoundation 0x000000010852821d -[__NSArrayM dealloc] + 157 16 libobjc.A.dylib 0x0000000107ecc28e _ZN11objc_object17sidetable_releaseEb + 236 17 UIKit 0x0000000106d19020 -[UIViewController dealloc] + 1003 18 UIKit 0x0000000106d3c1bc -[UINavigationController dealloc] + 452 19 <redacted> 0x0000000104b6174e -[ViewController .cxx_destruct] + 158 20 libobjc.A.dylib 0x0000000107eb6448 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127 21 libobjc.A.dylib 0x0000000107ec49b1 objc_destructInstance + 96 22 libobjc.A.dylib 0x0000000107ec49e4 object_dispose + 22 23 UIKit 0x0000000106d6df4a -[UIResponder dealloc] + 90 24 UIKit 0x0000000106d19398 -[UIViewController dealloc] + 1891 25 libobjc.A.dylib 0x0000000107ecc8cd _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 591 26 CoreFoundation 0x0000000108533f06 _CFAutoreleasePoolPop + 22 27 CoreFoundation 0x0000000108567dd3 __CFRunLoopRun + 2051 28 CoreFoundation 0x0000000108567366 CFRunLoopRunSpecific + 470 29 GraphicsServices 0x000000010a661a3e GSEventRunModal + 161 30 UIKit 0x0000000106bea8c0 UIApplicationMain + 1282 31 <redacted> 0x0000000104aa666b main + 379 32 libdyld.dylib 0x0000000108c49145 start + 1 33 ??? 0x0000000000000001 0x0 + 1 ) 2015-08-21 09:57:16.451 <redacted>[93092:14603781] *** Terminating app due to uncaught exception 'NSObjectInaccessibleException', reason: 'This application is not allowed to access Photo data.' *** First throw call stack: ( 0 CoreFoundation 0x000000010863ec65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x0000000107eb7bb7 objc_exception_throw + 45 2 PhotoLibraryServices 0x000000010a0a5d06 -[PLPhotoLibrary initWithTransientContext:name:] + 725 3 Photos 0x0000000104fb35a4 __30-[PHPhotoLibrary photoLibrary]_block_invoke + 59 4 libdispatch.dylib 0x0000000108c14614 _dispatch_client_callout + 8 5 libdispatch.dylib 0x0000000108c00881 dispatch_once_f + 565 6 Photos 0x0000000104fb3563 -[PHPhotoLibrary photoLibrary] + 140 7 Photos 0x0000000104f88af2 -[PHCoreImageManager _cancelAndFlushPreheatItemsForAssets:CPLPrefetching:domain:operation:passingTestHandler:didCancelHandler:] + 178 8 Photos 0x0000000104fa26cf -[PHImageManager dealloc] + 176 9 libobjc.A.dylib 0x0000000107ecc28e _ZN11objc_object17sidetable_releaseEb + 236 10 <redacted> 0x0000000104aeef3a -[ViewController .cxx_destruct] + 106 11 libobjc.A.dylib 0x0000000107eb6448 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127 12 libobjc.A.dylib 0x0000000107ec49b1 objc_destructInstance + 96 13 libobjc.A.dylib 0x0000000107ec49e4 object_dispose + 22 14 UIKit 0x0000000106d6df4a -[UIResponder dealloc] + 90 15 UIKit 0x0000000106d19398 -[UIViewController dealloc] + 1891 16 CoreFoundation 0x00000001085148eb CFRelease + 603 17 CoreFoundation 0x000000010852821d -[__NSArrayM dealloc] + 157 18 libobjc.A.dylib 0x0000000107ecc28e _ZN11objc_object17sidetable_releaseEb + 236 19 UIKit 0x0000000106d19020 -[UIViewController dealloc] + 1003 20 UIKit 0x0000000106d3c1bc -[UINavigationController dealloc] + 452 21 <redacted> 0x0000000104b6174e -[ViewController .cxx_destruct] + 158 22 libobjc.A.dylib 0x0000000107eb6448 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127 23 libobjc.A.dylib 0x0000000107ec49b1 objc_destructInstance + 96 24 libobjc.A.dylib 0x0000000107ec49e4 object_dispose + 22 25 UIKit 0x0000000106d6df4a -[UIResponder dealloc] + 90 26 UIKit 0x0000000106d19398 -[UIViewController dealloc] + 1891 27 libobjc.A.dylib 0x0000000107ecc8cd _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 591 28 CoreFoundation 0x0000000108533f06 _CFAutoreleasePoolPop + 22 29 CoreFoundation 0x0000000108567dd3 __CFRunLoopRun + 2051 30 CoreFoundation 0x0000000108567366 CFRunLoopRunSpecific + 470 31 GraphicsServices 0x000000010a661a3e GSEventRunModal + 161 32 UIKit 0x0000000106bea8c0 UIApplicationMain + 1282 33 <redacted> 0x0000000104aa666b main + 379 34 libdyld.dylib 0x0000000108c49145 start + 1 35 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException Version: IOS 8.4, Xcode Version 6.4 (6E35b) Notes: Configuration: any iOS device in Simulator and on real devices: iPhone 4s, 5, 5s, 6 & 6+ Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!