objective c - How to read from usb mass storage device when AppSand box is enabled -


in app, when user connects usb device (phone), use nsworkspacedidmountnotification notify user device detected performing nsalert.

if accepted, app proceed copy(read) text file contents device. worked fine until enabled appsandbox. have enabled usb entitlement when app tries copy, following error.

error reading content of file: error domain=nscocoaerrordomain code=257 "the file “office.txt” couldn’t opened because don’t have permission view it." userinfo={nsfilepath=/volumes/officedrive//documents/office.txt, nsunderlyingerror=0x600000049390 {error domain=nsposixerrordomain code=1 "operation not permitted"}}

is possible read usb device if appsandbox enabled.

you can access files user explicitly grants access if you're sandboxed:

user-specified files. sandboxed app (with appropriate entitlement) automatically obtains access files in arbitrary locations when files explicitly opened user or dragged , dropped onto application user.

(app sandbox design guide)

so you'd have open file dialog (probably pointing location you've figured out notification) , have user pick in order gain access.

remotely related post:


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -