0
我使用this tutorial來設置我的Parse應用程序的註冊視圖,並且我想使用additionalField
,但我希望它是一個可選字段。在提交之前所有的字段都填補了MySignUpViewController
檢查,以確保該方法是像這樣:如何使PFSignupViewController中的一個字段爲可選
// Sent to the delegate to determine whether the sign up request should be submitted to the server.
- (BOOL)signUpViewController:(PFSignUpViewController *)signUpController shouldBeginSignUp:(NSDictionary *)info {
BOOL informationComplete = YES;
// loop through all of the submitted data
for (id key in info) {
NSString *field = [info objectForKey:key];
if (!field || !field.length) { // check completion
informationComplete = NO;
break;
}
}
// Display an alert if a field wasn't completed
if (!informationComplete) {
[[[UIAlertView alloc] initWithTitle:@"Missing Information" message:@"Make sure you fill out all of the information!" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil] show];
}
return informationComplete;
}
這意味着,它遍歷所有的領域,並要求他們都在他們的東西移動到下一個步驟。如何告訴循環在循環時忽略additionalField
?
使完全感覺和工作完美,謝謝!原來,關鍵是「額外的」,對於任何嘗試這樣做的人來說。 – Ghobs 2014-10-20 02:50:09