ios - how do i return an NSString or NSUrl from my didFinishPickingMediaWithInfo? -


Good day, I am trying to implement UIImagePickerController inside my selectFile function. (This tutorial has been followed) But on the basis of the code given below, a little bit of tuke is what I want @implementation FileBrowser - (zero) selection file {UIImagePickerController * picker = [ [UIImagePickerController alloc] init]; Picker.delegate = self; Picker.allowsEditing = No; Picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [Self present ViewController: animated picker: yes complete: zero]; } #pragma Mark - Image Picker Controller Representative Methods - (Zero) imagePickerController: (UIImagePickerController *) Picker didFinishPickingMediaWithInfo: {NSDictionary *) Information {NSURL * refURL = [Info valueForKey: UIImagePickerControllerReferenceURL]; NSString * myURL = [refURL absolustString]; // Not in the tutorial, I am trying to get the URL / path here, with the intention of returning "callFileBrowser" [Picker Discoverer ControllerApplied: Yes Completed: Zero]; } @ And

Based on what I understand, my image is called Picture Controller Function when the user selects an image. My question is how do I get url (or receive) instead? I have a C function on the same file (but @implemetation), this function calls my selectFile and is considered to return to the URL / path of what user has been selected.

  four * callFileBrowser () {[Filebrowser selectfile]; // return myURL here; }  

I hope I was able to explain everything properly. Any advice would be greatly appreciated.

After

I do not think it is possible with the current design. CallFileBrowser () is asked to select an image, then it is necessary to immediately return a value. When we will be picking up the user, I do not know if you suggest to post a notification in DidFinishPickingMediaWithInfo when the URL is ready to inform other object which it needs.


Comments