views:

55

answers:

1

When Using UIPickerController I have two choices on my App:

  • take a picture
  • take a picture from the library (photo album)

but the library itself is composed by two parts:

  • camera roll
  • other photo albums

Is there a way to detect if the picture was selected from the camera roll or from the other photo albums?

thanks for any help.

+1  A: 

I don't think the API allows this. But you can always check the file's time stamp. If it's very new (a couple of sec before), probably it's not a library picked file. Just a trick, may not be foolproof though.

Mugunth Kumar
good idea. Not 100% but can help... just one little question.. how do I know the file stamp of the selected file if all the picker gives is a UIImage?
Digital Robot
Use the NSFileManager attribute NSFileModificationDate http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSFileModificationDate
Mugunth Kumar