Forum Archive

DocumentPicker Mode Type?

filippocld

I was trying to implement a document picker in Pythonista with objc_util ( you know i love this module xD) but i have a problem:
When i have to initWithDocumentType_inMode() i insert the doc type but the mode gives an error if i put "UIDocumentPickerModeImport" as a string.
What can i do to solve this problem?
Thanks in advance,
Filippo

JonB

@filippocld said:

UIDocumentPickerModeImport

check the type encoding, you will see that is expecting an unsigned int.
next, if you check the framework docs, at the bottom under constants you will see

typedef NS_ENUM (NSUInteger,
   UIDocumentPickerMode ) {
   UIDocumentPickerModeImport,
   UIDocumentPickerModeOpen,
   UIDocumentPickerModeExportToService,
   UIDocumentPickerModeMoveToService 
}

so modeimport is 0, modeopen is 1, etc.

JonB

do report back on your experiments ... reading through the docs, i believe iCloud support had to be enabled in the info.plist for this to work. also it seems perhaps the app must be released in the app store.