Friday 15 August 2014

ios - How to make one of the fields in PFSignupViewController optional -



ios - How to make one of the fields in PFSignupViewController optional -

i'm using this tutorial set signup view of parse app, , want create utilize of additionalfield, except want optional field. way mysignupviewcontroller checks create sure fields filled before submitting so:

// sent delegate determine whether sign request should submitted server. - (bool)signupviewcontroller:(pfsignupviewcontroller *)signupcontroller shouldbeginsignup:(nsdictionary *)info { bool informationcomplete = yes; // loop through of submitted info (id key in info) { nsstring *field = [info objectforkey:key]; if (!field || !field.length) { // check completion informationcomplete = no; break; } } // display alert if field wasn't completed if (!informationcomplete) { [[[uialertview alloc] initwithtitle:@"missing information" message:@"make sure fill out of information!" delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil] show]; } homecoming informationcomplete; }

this means loops through fields , requires them have in them move onto next step. how can tell loop ignore additionalfield when looping?

the goal create informationcomplete = yes. can like:

// loop through of submitted info (id key in info) { if (![key isequaltostring:@"keytoignore"]) { //if key not equal specified string go on execution nsstring *field = [info objectforkey:key]; if (!field || !field.length) { // check completion informationcomplete = no; break; } } }

this prevent checking field want ignore see if empty. figure out it's key , give go. allow me know how goes, luck!

ios objective-c parse.com

No comments:

Post a Comment