Need to simulate Camera of iphone simulator

Discussion in 'iOS Programming' started by ilx.mac, Apr 17, 2009.

  1. macrumors member

    Joined:
    Mar 10, 2009
    #1
    I need to simulate the camera of iphone through code. I know that its possible. But I am not sure on how to perform that action. can some one help me on this?
     
  2. macrumors member

    chbeer

    Joined:
    Sep 22, 2008
    Location:
    Berlin
    #2
    I never heard that it's possible... so why are you that shure? where did you get that information from?
     
  3. macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #3
    It isn't possible, although I can't see why Apple couldn't have given the simulator the ability to use the iSight camera built into the majority of Macs to simulate the camera functionality
     
  4. thread starter macrumors member

    Joined:
    Mar 10, 2009
    #4
    I came across some forums & they said its possible. But u cant view the action on the simulator. for the same it will work on iphone. So, is there a code sample to make it work?
     
  5. macrumors 68000

    Joined:
    Nov 3, 2007
    #5
    Can't be done, put it on your phone to test it.
     
  6. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    So why not ask them: we all seem pretty sure you can't do it in the simulator (just like sending email or SMS messages don't work in the simulator).
     
  7. thread starter macrumors member

    Joined:
    Mar 10, 2009
    #7
    I know you guys have pretty much experience than the others. So, now I believe that its not possible with simulator. Will it work with iphone? If yes, can some one provide me guidance? Please!
     
  8. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    Will what work? Using the camera? Yes, you can use it using the normal API as covered in the developer documentation. I suggest you go read it....
     
  9. thread starter macrumors member

    Joined:
    Mar 10, 2009
    #9
    if possible can you please be specific on what i should look @. (ie., some class/ framework name & its methods) Please!
     
  10. macrumors 68000

    Joined:
    Nov 3, 2007
    #10
    UIImagePickerController
     
  11. thread starter macrumors member

    Joined:
    Mar 10, 2009
    #11
    Thanks for the inputs & it worked.

    This is what i used:

    UIImagePickerController *picker = [[[UIImagePickerController alloc] init] autorelease];
    [picker setDelegate:self];
    [picker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    [self.navigationController presentModalViewController:picker animated:YES];
     

Share This Page