Qbimagepickercontroller photos in photo Stream are not selectable

Source: Internet
Author: User

Because Qbimagepickercontroller uses the alassetslibrary way to read the picture, if the default way to execute, then according to the URL read asset will be empty, this time we need special processing

1 [Self.assetslibrary Assetforurl:selectedasseturl2resultblock:^ (Alasset *Asset) {3                                 //ADD Asset4 5                                 //Normal Photo mode6                                 if(asset) {7 [Assets Addobject:asset];8 //Check If the loading finished9                                     if(Assets.count = =weakSelf.selectedAssetURLs.count) {Ten                                         //Delegate One                                         if(self.)Delegate&& [Self.Delegaterespondstoselector: @selector (imagepickercontroller:didselectassets:)]) { A[Self.Delegateimagepickercontroller:self didselectassets:[assets Copy]]; -                                         } -                                     } the                                 } -                                 //Photo Stream Mode -                                 Else{ -                                     //How to handle photo streams +[Self.assetslibrary enumerategroupswithtypes:alassetsgroupphotostream usingblock:^ (ALAssetsGroup *group, BOOL *stop) -                                      { +[Group Enumerateassetswithoptions:nsenumerationreverse usingblock:^ (Alasset *result, Nsuinteger index, BOOL *stop) { A                                               at                                              if([Result.defaultRepresentation.url Isequal:selectedasseturl]) { - [Assets Addobject:result]; -*stop =YES; - //Check If the loading finished -                                                  if(Assets.count = =weakSelf.selectedAssetURLs.count) { -                                                      //Delegate in                                                      if(self.)Delegate&& [Self.Delegaterespondstoselector: @selector (imagepickercontroller:didselectassets:)]) { -[Self.Delegateimagepickercontroller:self didselectassets:[assets Copy]]; to                                                      } +                                                  } -                                              } the                                          }]; *} failureblock:^ (Nserror *error) { $Ddlogverbose (@"Cann ' t found asset from stream:%@", [Error localizeddescription]);Panax Notoginseng                                      }]; -                                      the                                 } +} failureblock:^ (Nserror *error) { ANSLog (@"Error:%@", [Error localizeddescription]); the}];

Qbimagepickercontroller photos in photo Stream are not selectable

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.