Guest User

Untitled

a guest
Feb 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. NSURL *url = [NSURL URLByResolvingBookmarkData:file.bookmarkData
  2. options:NSURLBookmarkResolutionWithSecurityScope
  3. relativeToURL:nil
  4. bookmarkDataIsStale:nil
  5. error:nil];
  6. [url startAccessingSecurityScopedResource];
  7. ...
  8. [self.connection.remoteObjectProxy getDataFromURL:url
  9. withReply:aReply];
  10.  
  11. - (void)getDataFromURL:(NSURL *)anURL
  12. withReply:(void (^)(NSData *))aReply {
  13. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
  14. aReply([NSData dataWithContentsOfURL:anURL]);
  15. });
  16. }
Add Comment
Please, Sign In to add comment