- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试运行 Apple 的 PhotoPicker 示例,但它在 4.0 模拟器下崩溃了。不过在 4.3 下它不会崩溃。有人有这个问题吗? SDK 版本之间是否发生了某些变化会导致此 nil 对象问题?
它死在这条线上:
// as a delegate we are being told a picture was taken
- (void)didTakePicture:(UIImage *)picture
{
[self.capturedImages addObject:picture];
}
这是错误输出:
GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".Attaching to process 79426.
2011-07-06 15:04:53.265 PhotoPicker[79426:207] Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
2011-07-06 15:04:53.268 PhotoPicker[79426:207] Using two-stage rotation animation is not supported when rotating more than one view controller or view controllers not the window delegate
2011-07-06 15:04:56.432 PhotoPicker[79426:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'
*** Call stack at first throw:
(
0 CoreFoundation 0x0255a919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x026a85de objc_exception_throw + 47
2 CoreFoundation 0x02554571 -[__NSArrayM insertObject:atIndex:] + 225
3 CoreFoundation 0x0254f9c4 -[__NSArrayM addObject:] + 68
4 PhotoPicker 0x00002d93 -[MyViewController didTakePicture:] + 65
5 PhotoPicker 0x00004442 -[OverlayViewController imagePickerController:didFinishPickingMediaWithInfo:] + 132
6 UIKit 0x00481a74 -[UIImagePickerController _imagePickerDidCompleteWithInfo:] + 139
7 PhotoLibrary 0x0c3c3070 PLNotifyImagePickerOfImageAvailability + 1746
8 PhotoLibrary 0x0c3d8891 -[PLUIAlbumViewController albumView:didTapPhotoAtIndex:] + 429
9 PhotoLibrary 0x0c426431 -[PLAlbumView _tapGesture:] + 385
10 UIKit 0x0052b394 -[UIGestureRecognizer _updateGestureWithEvent:] + 727
11 UIKit 0x00527bf3 -[UIGestureRecognizer _delayedUpdateGesture] + 47
12 UIKit 0x0052c486 _UIGestureRecognizerUpdateObserver + 637
13 UIKit 0x0052d798 _UIGestureRecognizerUpdateGesturesFromSendEvent + 51
14 UIKit 0x002dbbcd -[UIWindow _sendGesturesForEvent:] + 1292
15 UIKit 0x002d713a -[UIWindow sendEvent:] + 105
16 UIKit 0x002bb1ec -[UIApplication sendEvent:] + 447
17 UIKit 0x002bfac4 _UIApplicationHandleEvent + 7495
18 GraphicsServices 0x02dc0afa PurpleEventCallback + 1578
19 CoreFoundation 0x0253bdc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
20 CoreFoundation 0x0249c737 __CFRunLoopDoSource1 + 215
21 CoreFoundation 0x024999c3 __CFRunLoopRun + 979
22 CoreFoundation 0x02499280 CFRunLoopRunSpecific + 208
23 CoreFoundation 0x024991a1 CFRunLoopRunInMode + 97
24 GraphicsServices 0x02dbf2c8 GSEventRunModal + 217
25 GraphicsServices 0x02dbf38d GSEventRun + 115
26 UIKit 0x002c3b58 UIApplicationMain + 1160
27 PhotoPicker 0x000031f8 main + 102
28 PhotoPicker 0x000027bd start + 53
29 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
sharedlibrary apply-load-rules all
Current language: auto; currently objective-c
(gdb)
最佳答案
我遇到了一个奇怪的问题,iOS 4.3 上的模拟器/设备在从照片库中选择图像时随机崩溃,通常使用 PLAlbumView 或 PLUIALbumViewController 上的方法作为堆栈跟踪中的最后一行。
我正在关闭模态照片 View Controller ,并立即呈现另一个模态视图 Controller - 因此动画是不必要的。iOS 5 上没有发生崩溃。
我认为这可能是一个竞争条件,根据问题 Presenting a modal view controller immediately after dismissing another
事实证明,当我改变从 VC 解雇
[myPhotoLibrary dismissModalViewControllerAnimated:YES];
至
[myPhotoLibrary dismissModalViewControllerAnimated:NO];
崩溃消失了。似乎是框架中的一个错误。
关于iphone - iOS PhotoPicker 示例在 4.0 模拟器下崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6593371/
我最近从developer.apple.com 下载了PhotoPicker 示例代码应用程序,因为我对iOS 还比较陌生。 为什么在其他代码或 Interface Builder nib 中的任何地
我想显示一个 photoPicker,但只显示特定格式的图像(png 和 jpeg)。 目前我有这个: Intent photoPickerIntent = new Intent(Intent.ACT
我尝试运行 Apple 的 PhotoPicker 示例,但它在 4.0 模拟器下崩溃了。不过在 4.3 下它不会崩溃。有人有这个问题吗? SDK 版本之间是否发生了某些变化会导致此 nil 对象问题
想要改进此帖子? 提供此问题的详细答案,包括引用和对答案正确原因的解释。不够详细的答案可能会被编辑或删除。 我正在尝试在 UIImageView 中显示照片库中的图像 完整的错误是: 2017-06
我的代码在 iOS 10 上运行良好,但在更新到 iOS 11 后似乎没有任何效果。 这是我在 facebook 上分享视频的代码: internal func imagePickerControll
我是一名优秀的程序员,十分优秀!