本章将来讲解下如何实现拍照的功能
我们需要的实现的效果是
好了 直接开始内容吧
首先我们需要新建一个ViewController
就叫AddPictureViewController
然后选择.h文件进行如下修改
1 #import <UIKit/UIKit.h> 2 3 @interface AddPictureViewController : UIViewController<UIImagePickerControllerDelegate,UINavigationControllerDelegate,UIAlertViewDelegate> 4 { 5 UITextView *contenttextview; 6 UIImageView *contentimageview; 7 NSString *lastChosenMediaType; 8 9 } 10 @property(nonatomic,retain) IBOutlet UITextView *contenttextview; 11 @property(nonatomic,retain) IBOutlet UIImageView *contentimageview; 12 @property(nonatomic,copy) NSString *lastChosenMediaType; 13 -(IBAction)buttonclick:(id)sender; 14 15 @end