美文网首页
一次令人崩溃的bug调试(iOS相机崩溃)

一次令人崩溃的bug调试(iOS相机崩溃)

作者: 逐水而上 | 来源:发表于2016-11-01 17:37 被阅读1958次

    过程很痛苦,结果很无奈。

    今天调试程序点击按钮调起系统相机,结果无论多少次,都是直接崩溃,抛出异常如下:

    libsystem_kernel.dylib`__abort_with_payload:
        0x183a58d94 <+0>:  movz   x16, #0x209
        0x183a58d98 <+4>:  svc    #0x80
    ->  0x183a58d9c <+8>:  b.lo   0x183a58db4               ; <+32>
        0x183a58da0 <+12>: stp    x29, x30, [sp, #-16]!
        0x183a58da4 <+16>: mov    x29, sp
        0x183a58da8 <+20>: bl     0x183a3d7dc               ; cerror_nocancel
        0x183a58dac <+24>: mov    sp, x29
        0x183a58db0 <+28>: ldp    x29, x30, [sp], #16
        0x183a58db4 <+32>: ret
    

    因为我已经把手机升到了iOS10,如果要访问相机必须在plist中加入询问,否则会一直崩溃到你想摔键盘。

    另外:

    cameraOverlayView支持了UIImagePickerController拍照视图的自定义。
    之前没有自定义过这个属性,初次弄,就栽了一个大跟头。

    You can access this property only when the source type of the image picker is set to UIImagePickerControllerSourceTypeCamera. Attempting to access this property for other source types results in throwing an NSInvalidArgumentException exception.

    文档中有这样一句话,是说,必须首先设置UIImagePickerControllerSourceTypeCamera,然后才能设置cameraOverlayView,这两个前后顺序是必须的,否则会crash。

    相关文章

      网友评论

          本文标题:一次令人崩溃的bug调试(iOS相机崩溃)

          本文链接:https://www.haomeiwen.com/subject/emimuttx.html