hi,
trying asign actions action sheet button nothing happening. have xcode 4.3. following code. please tell me wrong. want chose source of imagepicker action sheet.
code:
- (ibaction)choosephoto { // show image picker allow user choose new photo. uiactionsheet *actionsheet = [[uiactionsheet alloc] initwithtitle: @"choose source" delegate:self cancelbuttontitle:nil destructivebuttontitle:nil otherbuttontitles:@"take photo", @"choose photo", nil]; [actionsheet showinview:self.view]; [actionsheet release]; }
and command line action sheet
code:
- (void)actionsheet:(uiactionsheet *)actionsheet willdissmisswithbuttonindex:(nsinteger)buttonindex { switch (buttonindex) { case 0: { uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init]; imagepicker.delegate = self; imagepicker.sourcetype = uiimagepickercontrollersourcetypecamera; [self presentmodalviewcontroller:imagepicker animated:yes]; [imagepicker release]; break; } case 1: { uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init]; imagepicker.delegate = self; imagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; [self presentmodalviewcontroller:imagepicker animated:yes]; [imagepicker release]; break; } } }
thanx
you have xcode 4.3? really?
delegate method actionsheet:willdismisswithbuttonindex:. in code posted, have misspelt dismiss dissmiss.
can make personal request? don't put word or exclamation marks in thread subjects. neither more assistance, , in fact may dissuade helping you.
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
Comments
Post a Comment