iOS:After I taken photo use my iphone camera,how to get the picture counter-ALAsset?

64 Views Asked by At

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

1

There are 1 best solutions below

3
Bhadresh Mulsaniya On
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 
    }
 ];