I am working in phonegap Camera API new to objective c i dont know how to declare method and interface for this function in .h file
if([(NSString *) [components objectAtIndex:1] isEqualToString:@"Take_Photo"])
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsImageEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
}
I’ve declared UIImagePickerControllerDelegate in .h file but the camera is not opening.
i did not get any error when i debugging the application paused after completed the line
[self presentModalViewController:picker animated:YES];
the application debugger paused in the binary file. i think i missed something in .h file.
@interface NativeAPI :UIViewController
<UIWebViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
{
Reachability* internetReachable;
Reachability* hostReachable;
UIImagePickerController* Image_Picker;
}
any one help me thanks in advance
You will be required to assign the value of the picker to the instance variable like this.
Try the code above
You can define a method under the implementation which is to be called by the delegate.