Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
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?
 

chbeer

macrumors member
Sep 22, 2008
82
0
Berlin
I never heard that it's possible... so why are you that shure? where did you get that information from?
 

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
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
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
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?
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
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!
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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!

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....
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
if possible can you please be specific on what i should look @. (ie., some class/ framework name & its methods) Please!
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
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];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.