Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iphonejudy

macrumors 6502
Original poster
Sep 12, 2008
301
1
I saw the below code in document.

I need to call the below code in some method
Code:
-(BOOL)startCameraPickerFromViewController:(UIViewController*)controller usingDelegate:(id<UIImagePickerControllerDelegate>)delegateObject

{

    if ( (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])

            || (delegateObject == nil) || (controller == nil))

        return NO;

 

    UIImagePickerController* picker = [[UIImagePickerController alloc] init];

    picker.sourceType = UIImagePickerControllerSourceTypeCamera;

    picker.delegate = delegateObject;

    picker.allowsImageEditing = YES;

 

    // Picker is displayed asynchronously.

    [controller presentModalViewController:picker animated:YES];

    return YES;

}

I used
Code:
[self:startCameraPickerFromViewController:controller usingDelegate:delegateObject];
But i got error
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.