QLPreviewView can not show the quicklook preview in sandbox
I use QLPreviewView to show the quicklook preview in the app. Without sandbox, this works well, but once change the app to sandbox, the preview can not show up. I found the error in Console: QuickLookUIHelpe(20786) deny file-read-data XXX. I have used the security-scoped bookmarks & com.apple.security.files.user-selected.read-write to grant access the user home dir, then: [allowedURL startAccessingSecurityScopedResource]; self.myPreiviewItem.myURL = fileURL; self.myQLPreviewView.previewItem = self.myPreiviewItem; [self.myQLPreviewView refreshPreviewItem]; [allowedURL