사용자가 가입 할 때 구문 분석을 사용하는 응용 프로그램에 프로필 그림을 추가하고 싶지만 이렇게하려면 새로운 ViewController를 만들고 싶지 않습니다. 모든 필드가 완료 될 때까지그림을 선택하기 전까지 구문 분석을 완료하지 마십시오
- (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 == 0 || ![signUpController.signUpView.additionalField.text containsString:@" "]) { // 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, including first & last name!"
delegate:nil
cancelButtonTitle:@"ok"
otherButtonTitles:nil] show];
}
return informationComplete;
}
이 가입 절차를 떠받됩니다 shouldBeginSignUp
에 대한 대리자, 나는 기본이있다. 가입을 클릭하면 프로필 사진을 선택하거나 새로운 사진을 찍으라는 메시지가 UIActionSheet
팝업으로 표시됩니다. 사진이 찍히면 PFUser에 추가됩니다. 이 일을 어떻게 제안 하시겠습니까?
어디서 붙어 있습니까? –
그림이 선택되지 않은 경우 false를 반환하고 UIImagePickerController (https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImagePickerController_Class/index.html)를 읽습니다. – danh