Has anyone experienced crashes when using ALAssetsLibrary in a background thread?

后端 未结 4 1555
死守一世寂寞
死守一世寂寞 2021-02-15 13:41

I have an ios app which has not crashed in this way on ios 5 which is now crashing consistently on ios 6 on startup after 4 or 5 bg/fg cycles. I\'ve traced the issue to my invo

4条回答
  •  攒了一身酷
    2021-02-15 14:20

    ALAssetsLibrary enumeration runs in the main thread (see this SO answer). I suspect this is because the assets library may want to interact with the user for permissions to use location data (because photos have geotagging).

    This may be the source of your problem, if your code assumes that ALAssetsLibrary will continue to run in a background thread.

提交回复
热议问题