Multiple UIImagePickerControllers

Discussion in 'iOS Programming' started by newtoiphonesdk, May 4, 2012.

  1. newtoiphonesdk macrumors 6502a

    Joined:
    Jul 30, 2010
    #1
    You can tag an ActionSheet in XCode, allowing you multiple action sheets to run with the one,
    Code:
    actionSheetUIActionSheet *)popup clickedButtonAtIndex:
    
    method. Is there any way to do the same thing with a UIImagePickerController?
     
  2. xStep, May 4, 2012
    Last edited: May 5, 2012

    xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #2
    I'm not understanding the question. Are you talking about multiple buttons?
     
  3. iosdev macrumors newbie

    Joined:
    May 4, 2012
    #3
    Yes, all delegates of imagepicker view returns picker itself, so when you add a tag to any of it's view, you can retrieve it later

    Code:
    UIImagePickerController *pic, *pic2;
        pic.topViewController.view.tag = 1;
        pic2.topViewController.view.tag = 2;
    And on returning function simply do

    Code:
    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
    
    if (picker.topViewController.view.tag == 1) {
    
    }else {
    
    }
    }
    
     

Share This Page