Search code examples
iphoneiphone-sdk-3.0ios4avfoundation

How to just take a photo with iPhone


Is there a way to just take a photo with an iPhone?

(No delegates or controllers).

Actually what I want is:

1 One view that shows what the camera is seeing,

2) One button that takes a photo. (Like calling a function and getting the photo back)

added:The "view" above would be an area in a normal screen, also the button

Would this be the AVFoundation.

Thanks


Solution

  • If you're just trying to use the camera the AVFoundation framework is way overdoing it, and it's meant more for sounds and movies. The basic camera methods are all in the UIKit framework. If you're trying to edit the images, the AVFramework isn't what you need.

    Also, you cannot have an app without a delegate or a controller. That's how apps are made. Without them you can't do anything. See the Apple View Controller Programming Guide for more information.

    Like falconcreek said, you need to use a UIImagePickerController and set the UIImagePickerDelegate to use the camera in an app.

    Question: What are you trying to do with these images that the Camera app won't work?