AssetsLibrary cannot obtain all local albums

Source: Internet
Author: User

There are two local albums: Camera Film and Photo Gallery. The latter is generated through synchronization.

Dispatch_async (dispatch_get_main_queue (), ^ {[_ assetsLibrary partition: ALAssetsGroupAll usingBlock: ^ (ALAssetsGroup * group, BOOL * stop) {if (group) {[self. groupArray addObject: group]; [self generated mselecw.mainthread: @ selector (reloadTableView) withObject: nil waitUntilDone: YES] ;}} failureBlock: ^ (NSError * error) {NSLog (@ "Group not found! N "); self. title = @" failed to access the Photo "; // Photo-access is disabled.}];});

Count the number of albums by enumerating the groups of the ALAssetsGroupAll type. The result is only one.

I am confused because I am using the All option. After pondering for a long time, I finally found the reason in a detail: I think Line 44 is awkward. Why should I leave a blank Line, I couldn't help but habitually Delete this line-it turns out this is a library file. So I went back to Line 44 and looked at it: there was a Line break comment behind it, and the words like "exception" and "not" shook me -- the original ALAssetsGroupLibrary was not included!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.