Currently I have a view with an ImageViewer and 2 buttons (Browse & Upload). I’m currently searching for methods to display the iPhone photo album once the button is pressed.
I’ve looked at this example here but I assume this one is the method you call when you want to upload the photo into the server.
Objective C: How to upload image and text using HTTP POST?
I’d like to duplicate the functionality of a web upload form.
1. Click button to browse folders.
2. Choose photo and display in a container.
3. Click Upload to upload photo into the server.
**Update:
Found some nice tutorials that helped me start with my iPhone app photo upload form.
Using UIImagePickerController
http://trailsinthesand.com/picking-images-with-the-iphone-sdk-uiimagepickercontroller/
You will have to use
UIImagePickerControllerclassHere is the class reference for UIImagePickerController
Initialize the picker controller in your button event handler method.
Then set the
UIImagePickerControllerDelegateto your current viewControllerHere is the class reference for UIImagePickerControllerDelegate
Set the
UIImagePickerControllerSourceTypeof picker toUIImagePickerControllerSourceTypePhotoLibrarypicker.UIImagePickerControllerSourceType = UIImagePickerControllerSourceTypePhotoLibraryThen present the pickerViewController (if your target device is an iPad, present the imagePickerView in a popOver control)
Once user selects an image picker controller will automatically call its delegate method
You can get the selected image by accessing the value for
UIImagePickerControllerOriginalImagefrom theNSDictionary *infoThen you can use the image for uploading to server as mentioned in the post link
These are some tutorials for UIImagePickerController
Tutorial one
Tutorial two
Tutorial three