objective c - Parse Config Change Value -
i using new(ish) parse.com 'config' in app. calling server info , displaying user. great having issues trying update info in server.
here how setting label:
- (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. [pfconfig getconfiginbackgroundwithblock:^(pfconfig *config, nserror *error) { nsstring *stringforstock = config[@"maintitle"]; self.stockoftheday.text = stringforstock; }]; }
works fantastic. wanted alter info in app whatever reason , update server. tried using:
[config setvalue:@"new title" forkey:config[@"maintitle"]];
well when run entire void, process never run.
-(ibaction)changetitle:(id)sender { nslog(@"newtitle"); [pfconfig getconfiginbackgroundwithblock:^(pfconfig *config, nserror *error) { nsstring *stringforstock = config[@"maintitle"]; self.stockoftheday.text = stringforstock; [config setvalue:@"new title" forkey:config[@"maintitle"]]; nslog(@"done"); }]; }
as may able see logs, 'newtitle' log run 'done' log not. doing wrong?
as far understand parse config, it's 1 way communication api, i.e. can config server (via getconfiginbackgroundwithblock:
), not write new info client. (source: https://parse.com/docs/ios_guide#config/ios)
if want update info on parse store, need utilize pfobjects.
objective-c string parse.com config
No comments:
Post a Comment