0

As the title, after I taken a photo with my iphone camera, how can I get the ALAsset, which is the photo?

lme
  • 59
  • 3
  • 17

1 Answers1

0
ALAssetsLibrary *al = [[ALAssetsLibrary alloc] init];


[al enumerateGroupsWithTypes:ALAssetsGroupAll

    usingBlock:^(ALAssetsGroup *group, BOOL *stop)
    {
        [group enumerateAssetsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop)
        {
            if (asset)
            {                
                 .. do something with the asset
            }
        }
        ];
    }

    failureBlock:^(NSError *error)
    {
        // User did not allow access to library
        .. handle error 
    }
 ];
Bhadresh Mulsaniya
  • 2,610
  • 1
  • 12
  • 25