好多余先生丶
好多余先生丶

Reputation: 311

UIDocumentBrowserViewController get file data

when i use UIDocumentBrowserViewController, and get file's documentURL ,like" file:///private/var/mobile/Containers/Data/Application/8F45C0E0-446B-4C89-A7AB-95E148BE0F41/Documents/sd1513175706_2.MP4 ", and i use [NSData dataWithContentsOfFile] to get data, but it's not work. what's the problem ?

Upvotes: 1

Views: 488

Answers (1)

Thomas Deniau
Thomas Deniau

Reputation: 2573

You need to call startAccessingSecurityScopedResource on that URL to consume the sandbox extension vended to you by the document browser. Don’t forget to call stopAccessing once you are done in order not to leak kernel resources.

Upvotes: 2

Related Questions