title: how to take picture from camera using iphone app
body: <p>I have implemented picture taking while pressing UI Button butwhen ever i pressed the button got app crashed.</p>
  
  <p>Here is the source code.</p>
  
  <pre><code>.h file
  @interface Camera : UIViewController
                                   &lt;UIImagePickerControllerDelegate&gt;
  {
     UIImagePickerController *mPicture;
  
  }
  @property (nonatomic, retain) UIImagePickerController *mPicture;
  
  .m file
  @implementaion Camera
  @synthesize mPicture; 
      -(void)pictureButtonPushed
      {
      UIImagePickerControllerSourceType mType = UIImagePickerControllerSourceTypeCamera;
          if ([UIImagePickerController isSourceTypeAvailable:mType]) 
          {
              mPicture.sourceType = mType;
              [self presentModalViewController:mPicture animated:YES];
          }
      }
  </code></pre>
  
  <p>Thanks in advance</p>