0

I want to get the timestamp when the image is captured in my application. Do we have any notification when the camera is clicked?

pushpa
  • 573
  • 2
  • 7
  • 19

1 Answers1

2

use UIImagePickerController delegate:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    NSDictionary *metadataDictionary = (NSDictionary *)[info valueForKey:UIImagePickerControllerMediaMetadata];
        // do something with the metadata

    NSLog(@"meta : %@ \n\n",metadataDictionary);
}
Aravindhan
  • 15,608
  • 10
  • 56
  • 71
NeverBe
  • 5,213
  • 2
  • 25
  • 39
  • yes exactly , this is the delegate method which gets called after that you have captured image or chosen a picture from library – HarshIT Feb 18 '12 at 12:41
  • @NeverBe: Thanks, But i can't understand how this method get called? – pushpa Feb 18 '12 at 13:00
  • https://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html – NeverBe Feb 18 '12 at 13:06
  • @pushpa : Its a delegate.. You can refer this link for knowing more about the delegates.. http://stackoverflow.com/questions/2534094/what-is-a-delegate-in-objective-cs-iphone-development – Aravindhan Feb 18 '12 at 13:07
  • @ NeverBe and Aravindhanarvi: Thanks, Using this method we can capture the image from our class. But how to capture the timestamp when the image is captured, how to observe from my application? – pushpa Feb 18 '12 at 14:23