iOS 9 read file permission

前端 未结 4 1110
谎友^
谎友^ 2020-12-20 15:16

In iOS 9+ I get a nil on any attempt to read from file. The file in this case is a image file path.
using

NSData(contentsOfFile: stringpath, options: NSD         


        
4条回答
  •  孤城傲影
    2020-12-20 16:08

    I encountered this error because I was attempting to access multiple files in the same block. The fix that worked for me was changing the code structure such that each file url was obtained, then read from, before attempting to get the next file url.

提交回复
热议问题