I want to use the UIDocumentPickerViewController to select a ".json" file. In the simulator this works fine but not on a real device :(
Image: http://i.imgur.com/bR0cRXn.jpg
@IBAction func btnImport(sender: AnyObject) {
let documentPicker = UIDocumentPickerViewController(documentTypes: [kUTTypeJSON as NSString], inMode: .Import)
documentPicker.delegate = self
presentViewController(documentPicker, animated: true, completion: nil)
}
func documentPicker(controller: UIDocumentPickerViewController,
didPickDocumentAtURL url: NSURL) {
// Do something
println(url)
}
Aucun commentaire:
Enregistrer un commentaire