ios - UIAlertView seems to freeze application when uploading data to Parse.com -


Hello, I'm using parse to help backend my iOS app and I've created a button that Upload my text to my textfield and cloud when I click a button

The code and warnings for the button that are popped up are as follows

  - (IBAction) Save button: (ID) sender {// Create PFObject with recipe information PFObject * recipe = [PFObject objectWithClassName: @ "golftime"]; [Recipe set object: _nameTextField.text forKey: @ "name"]; [Recipe set object: _prepTimeTextField.text forKey: @ "member number"]; [Recipe Set Object: _NumberOfGolfers.text forKey: @ "Number of Golfers"]; [Recipe Set Object: _RequestedTime.text forKey: @ "Requested Time"]; NSArray * Content = [_ingredientsTextField.text components] Separator String: @ ","]; [Recipe set object: for content of: @ "telephone"]; // Progress Show progress MBProgressHUD * hud = [MBProgressHUD showHUDAddedTo: animated self.view: yes]; Hud.mode = MBProgressHUDModeInderminate; Hud.labelText = @ "Sending ..."; [Hood show: yes]; // Upload the recipe to upload the pars [preserve the recipeBackgroundblogblock: ^ (Bull succeeded, NSERR * error) {[hide Hood:]; If (! Error) {// success message UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "Request sent" message: @ "We will get back to you with confirmation." Representative: Self cancelTutton title: @ "OK" other button button: zero, zero]; [Alerts show]; // Pars cloud [[NSNation Centers Default Center] Notify table view for reloading recipes by post notification name: @ "refresh" object:;]; // Dismiss the controller [Self Waste ViewControllerAnimated: Yes Completed: Zero]; } Else {UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "Upload Failure" Message: [Error Localized Description] Rep: Cancel AutoTitTitle: @ "OK" Other buttons: zero, zero]; [Alerts show]; Although} the data sends properly and the view controller closes, as I did, it seems to freeze the alarm app and I can not click the "OK" time of the time. When I click on the "OK" button the app simulator is turned off.  

Any suggestions or help?

I believe that you send UIAlertView to the main thread Required when you want to show them: Edit: You can not be representative of UIAlertView of UIViewController , you are now dismissed! This is the reason that it is crashing; To set the representative: Zero should be fixed.

  sending_sync (sending_at_man_que), ^ {UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "Sent request" message: @ "We'll get back to you with confirmation Will go. " Representative: Zero Cancel TutanTitil: @ "OK" Other button: Titles: zero, zero]; [Show warning]; [[Default center of NSNation center] Postnotification name: @ "Refreshable" object: Self]; [Self-viewable ViewController estimated: yes complete: zero];});  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -