ios - Parse.com: saveInBackgroundWithBlock - block not called -


I am using the latest version of Pars IOS SDK (v1.4.2) and really ready for iOS 8 I'm getting the app. ..

Now I came to the following problem:

A user is a member of a push channel using the saveInBackgroundWithBlock method to show a warning after using The membership was successful, so the subscription was successful. The problem is that the successful block has never been called!

The subscription is raising itself without any problem - the new channel is showing immediately on the Parse.com backend.

So I'm really confused! ;)

The only problem anyone has a solution, especially for

  PFInstallation * currentInstallation = [PFInstallation currentInstallation]; [AddUniqueObject to the current installation: that for the channel: @ "channel"]; [CurrentInstallation saveInBackgroundWithBlock: ^ (BOOL successful, NSError * error) {if (error!) {// Show Success warning UIAlertView * successAlert = [[UIAlertView alloc] initWithTitle: @ "success" message: no representatives: self cancelButtonTitle: @ "OK" other button: zero, zero]; [Aflert show]; } Else {// Show error alert UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle: @ "error" message: no representatives: self cancelButtonTitle: @ "OK" OtherButtonTitles: zero, zero]; [Error Alert Show]; }}];  

Update: I have played with it and have seen that the block has been called but my alert has not been shown ...

Always check successful param such as it is a little bit left with an Apple API. How can I do this? Also since you are targeting iOS8 I strongly believe that the new suggest using UIAlertController API

  PFInstallation * currentInstallation = [PFInstallation currentInstallation]. [AddUniqueObject to the current installation: that for the channel: @ "channel"]; [Current installation save in backgroundwatch: ^ (Bull succeeded, NSERR * error) {NSLog (@ "% @", [Error Locale Description]); // debug dispatch_async (dispatch_get_main_queue (), ^ {UIAlertController * Warning, if successful (& amp; & amp; error) {// success Warning = [UIAlertController alertControllerWithTitle: @ "success" message: preferredStyle zero: UIAlertControllerStyleAlert] ;! } Else {// error warning = [UIAlertController title with warning controller: @ "error" message: no favorite genre: UIAlertControllerStyleAlert]} UIAlertAction * defaultAction = [UIAlertAction title with action: @ "right" style: UIAlertActionStyleDefault handler: ^ (UIAlertAction * Action) {[Warning Dismiss ViewControllerAnimated: Yes Completed: Shun Other];}] [Warning AddAction: DefaultAction] [self current ViewController: Warning Animated: Yes Full minus];}); }];  

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

android - how to get distance of 2 beacons and make a condtion base on that distance -

c# - WPF Expander overlay used in ItemsControl -