Search code examples
iphoneios4uiimagepickercontrollerassetslibrary

MyImagePicker from WWDC 2010 sample code displays nothing


I compiled and ran the MyImagePicker project from the WWDC 2010 sample code on my iPhone 3Gs with iOS 4.2.1, but it just gives me a blank table. Shouldn't it be populating with data from my photo roll?

Interestingly, I also get a blank table in the UIImagePickerController Clone from iCodeBlog.

Both of these projects apparently use the AssetsLibrary framework -- what am I missing here?


Solution

  • I shouldn't have assumed that the picker would automatically select from the saved photos album.

    Change the following line in RootViewController.m from:

    NSUInteger groupTypes = ALAssetsGroupAlbum | ALAssetsGroupEvent | ALAssetsGroupFaces;
    

    to:

    NSUInteger groupTypes = ALAssetsGroupSavedPhotos;
    

    to just get saved photos... It turns out that this isn't any better for my purposes than the stock UIImagePickerController, but it was a learning experience.