0
我想添加個人資料圖片到我的應用程序,當用戶註冊時使用解析,但是我不想創建一個全新的ViewController來執行此操作。在委託shouldBeginSignUp
,我有基本的:不完成解析註冊直到圖片被選中
- (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;
}
,直到所有領域都完成這將托起註冊過程。我想要做的是在點擊註冊後,讓它彈出一個UIActionSheet
,要求選擇個人資料照片或拍攝新照片。拍攝照片後,它會將其添加到PFUser。你會如何建議這樣做?
你卡在哪裏? –
如果未選擇圖片,則返回false,然後閱讀有關UIImagePickerController(https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImagePickerController_Class/index.html) – danh