Select picture
1. Set up proxy <UIActionSheerDelegate>
2.UIActionSheet *sheet = [[Uiactionsheet alloc] initwithtitle:@ "Please select" delegate:self
cancelbuttontitle:@ "Cancel"
destructivebuttontitle:@ "Photography"
otherbuttontitles:@ "album", Nil];
3. Display [sheet ShowInView:self.view];
Agent for 4.actionsheet
(void) Actionsheet: (Uiactionsheet *) Actionsheet Clickedbuttonatindex: (Nsinteger) buttonindex{if (ButtonIndex = = 2) {// Cancel
Return
}
Uiimagepickercontroller *imagepicker = [[Uiimagepickercontroller alloc] init];
Set up Proxy
Imagepicker.delegate =self;
setting allows editing
imagepicker.allowsediting = YES;
if (Buttonindex = = 0) {//Photography
Imagepicker.sourcetype = Uiimagepickercontrollersourcetypecamera;
}else{//albums
Imagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary;
}
Show Picture Selector
[Self Presentviewcontroller:imagepicker animated:yes completion:nil]; }
#pragma the proxy for the Mark image selector
-(void) Imagepickercontroller: (Uiimagepickercontroller *) Picker Didfinishpickingmediawithinfo: (NSDictionary *) info {
Wclog (@ "%@", info);
Get Picture settings picture
UIImage *image = Info[uiimagepickercontrollereditedimage];
Self.haedView.image = image;
Hide the current modal window
[Self dismissviewcontrolleranimated:yes completion:nil];
Update to Server
[Self editprofileviewcontrollerdidsave];
}
Picture Selection (Camera/album)