views:

2042

answers:

2

When I run this code in the Simulator in the debugger or standalone

[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]

it tells me the camera is not available (returns NO), as expected.

However, if I run the same code in the simulator in Performance Tool, it returns YES! My code (which works fine on device) then continues to display the camera view in the simulator. If I attempt to capture an image though, I get a console message

photos can only be captured on HW

Which means that if I want to profile my application on the simulator (wouldn't it be nice if it worked on the device!!) I need to go change the code so that it displays the correct view (i.e. not the camera one!).

This does not, from googling, appear to be a well-known issue. Has anyone else experienced it and/or got a workaround?

+1  A: 

The obvious workaround is to add an

#if TARGET_IPHONE_SIMULATOR

but that's just icky. The whole point of doing the isSourceTypeAvailable in the first place is to avoid that sort of thing...

Airsource Ltd
+1  A: 

File a bug with Apple. They do read them.

millenomi