ios - Proper way to upload multiple images to Parse -


I am saving multiple images using an open source custom class called ELCImagePicker. To use ELCImagePicker, code is found in the controller's ViewDidLoad method for specific tabs.

ELCImagePickerController * imagePicker = [[ELCImagePickerController alloc] initImagePicker]; ImagePicker.maximumImagesCount = 20; ImagePicker.imagePickerDelegate = self; [Self present ViewController: animated imagePicker: yes complete: zero];

Currently, the method I use to upload images to myself is backend as a service

  - (Zero) elcImagePickerController: (ELCImagePickerController *) Picker didFinishPickingMediaWithInfo: (NSArray *) information {NSData * fileData; NSString * fileName; NSString * fileType; For (ID image in info) {fileData = UIImagePNG mapping (image); FileName = @ "image.png"; PFFile * imageFile = [PFFile FileWidthName: Filename Data: FileData]; [ImageFile saveInBackgroundWithBlock: ^ (BOOL succeeded, NSError * error) {if (error) {UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle: @ "image upload error" message: @ "Please try sending your image again "Representative: cancel itselfTutettitle: @" OK "other button titles: zero]; [Error Alert Show]; } Other {PFObject * message = [PFObject objectWithClassName: @ "Message"]; [Message Set Object: imageFile forKey: @ "imageFile"]; [Message Set Object: [[PFUser currentUser] objectId] forKey: @ "senderId"]; [Message Set Object: [[PFUser currentUser] user name] forKey: @ "user name"]; [Background with block in saving message: ^ (Bull succeeded, NSERR * error) {if (error) {UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle: @ "image upload error" message: @ "Please send your image again Try "Rep: Automatically cancel Tuittitle: @" OK "other button titles: zero]; [Error Alert Show]; }}]; }}]; }}  

First of all, the information is an array that has multiple images that are selected. I am currently calculating through the array and using Pars custom API to upload images. So far, I'm getting an error message that reads: "Take the 2014-04-28 11: 03: 58.574 one [42357: 90B] - [__SSMM CGImage]: For example the unfamiliar selector Received 0xe9749b0 2014-04-28 11: 03: 58.582 Take one [42357: 90b] Exclude API due to exception exception 'NSINID IDRA exception exception', reason: '- [___ NSITMM CGI ]: 0xe9749b0 ' First for Call Stack: Unknown

for unrecognized selector I'm thinking that there is a proper method for uploading multiple images to parsing, I'm not sure if this is a good job what I'm currently doing

Parsing is not a part that is throwing an error; information in the id image code> , So you are trying to convert a dictionary into a UIImage.

It should be:

 for  (information in NSDictionary * dictionary) {UIImage * image = Dictionary [UIImagePickerControllerOriginalImage]; // ELC UIImagePicker compiles its dictionaries with the same key as fileData = UIImagePNGRepresentation (image); // ... your other code ... //  

saves your purse is not a problem; However, they can be problematic because they do not keep track of which photo triggered an error, keep track of error photos in a different array, then inform the user that the photos failed to upload. Then give them the option of retrying those pictures.


Comments

Popular posts from this blog

Editing Python Class in Shell and SQLAlchemy -

import - Python ImportError: No module named wmi -

uislider - In a MATLAB GUI, how does one implement a continuously varying slider from a GUIDE created .m file? -