<i id='vE9jq'><tr id='vE9jq'><dt id='vE9jq'><q id='vE9jq'><span id='vE9jq'><b id='vE9jq'><form id='vE9jq'><ins id='vE9jq'></ins><ul id='vE9jq'></ul><sub id='vE9jq'></sub></form><legend id='vE9jq'></legend><bdo id='vE9jq'><pre id='vE9jq'><center id='vE9jq'></center></pre></bdo></b><th id='vE9jq'></th></span></q></dt></tr></i><div id='vE9jq'><tfoot id='vE9jq'></tfoot><dl id='vE9jq'><fieldset id='vE9jq'></fieldset></dl></div>

    <small id='vE9jq'></small><noframes id='vE9jq'>

    <tfoot id='vE9jq'></tfoot>

          <bdo id='vE9jq'></bdo><ul id='vE9jq'></ul>
        <legend id='vE9jq'><style id='vE9jq'><dir id='vE9jq'><q id='vE9jq'></q></dir></style></legend>

        使用 AssetsLibrary 框架 iPhone 访问库中的视频?

        时间:2023-10-22

          <bdo id='yhi0F'></bdo><ul id='yhi0F'></ul>

          <legend id='yhi0F'><style id='yhi0F'><dir id='yhi0F'><q id='yhi0F'></q></dir></style></legend>
        • <small id='yhi0F'></small><noframes id='yhi0F'>

          <tfoot id='yhi0F'></tfoot>
          1. <i id='yhi0F'><tr id='yhi0F'><dt id='yhi0F'><q id='yhi0F'><span id='yhi0F'><b id='yhi0F'><form id='yhi0F'><ins id='yhi0F'></ins><ul id='yhi0F'></ul><sub id='yhi0F'></sub></form><legend id='yhi0F'></legend><bdo id='yhi0F'><pre id='yhi0F'><center id='yhi0F'></center></pre></bdo></b><th id='yhi0F'></th></span></q></dt></tr></i><div id='yhi0F'><tfoot id='yhi0F'></tfoot><dl id='yhi0F'><fieldset id='yhi0F'></fieldset></dl></div>

                    <tbody id='yhi0F'></tbody>
                  本文介绍了使用 AssetsLibrary 框架 iPhone 访问库中的视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 AssetsLibrary 框架在以下代码的帮助下访问 iPhone 库中的视频...但是当我运行应用程序时,代码无法正常工作...数组资源仍然为空?我做错了什么?

                  I am trying to access videos in iPhone library using AssetsLibrary Framework with the help of following code...but when I run the application the code is not working...the array assets is still empty? What am I doing wrong?

                  顺便说一下,我的 iPhone 是 3G 升级到 iPhone 4.1.(但资产框架没有给出任何错误)

                  by the way my iPhone is a 3G upgraded to iPhone 4.1.(but assets framework is not giving any error)

                  NSMutableArray *assets = [[NSMutableArray alloc]init];
                  ALAssetsLibrary *library = [[ALAssetsLibrary alloc]init];
                  
                  void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop) {
                          if(result != NULL) {
                                  NSLog(@"See Asset: %@", result);
                                  [assets addObject:result];
                              }
                          };
                  
                      void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) =  ^(ALAssetsGroup *group, BOOL *stop) {
                          if(group != nil) {NSLog(@"dont See Asset: ");
                                  [group enumerateAssetsUsingBlock:assetEnumerator];
                              }
                          };
                  
                      assets = [[NSMutableArray alloc] init];
                      library = [[ALAssetsLibrary alloc] init];
                      [library enumerateGroupsWithTypes:ALAssetsGroupAlbum
                                             usingBlock:assetGroupEnumerator
                                           failureBlock: ^(NSError *error) {
                                                   NSLog(@"Failure");
                                               }];
                  

                  推荐答案

                  4.1 升级似乎已经破坏"了一些图像选择器示例,请注意以下几行,它们在您发布的代码之后运行:

                  the 4.1 upgrade seems to have 'broken' some of the image picker examples, observe the following lines, which run after the code you have posted:

                  NSUInteger groupTypes = ALAssetsGroupAlbum | ALAssetsGroupEvent | ALAssetsGroupFaces;
                  [assetsLibrary enumerateGroupsWithTypes:groupTypes usingBlock:listGroupBlock failureBlock:failureBlock];
                  

                  这使我的 4.1 iPhone 和模拟器上的资产为零.但是更改 groupTypes 会有所帮助,因此请设置

                  This gives zero assets both on my 4.1 iPhone and simulator. However changing the groupTypes helps, so set

                   NSUInteger groupTypes = ALAssetsGroupAll;
                  

                  您应该开始看到一些资产.

                  and you should start seeing some assets.

                  这篇关于使用 AssetsLibrary 框架 iPhone 访问库中的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:编辑同时删除 UITableView 中的多行 下一篇:iOS中的拨号真的需要确认吗?

                  相关文章

                  <small id='QwRJd'></small><noframes id='QwRJd'>

                  • <bdo id='QwRJd'></bdo><ul id='QwRJd'></ul>

                  <tfoot id='QwRJd'></tfoot>
                  <i id='QwRJd'><tr id='QwRJd'><dt id='QwRJd'><q id='QwRJd'><span id='QwRJd'><b id='QwRJd'><form id='QwRJd'><ins id='QwRJd'></ins><ul id='QwRJd'></ul><sub id='QwRJd'></sub></form><legend id='QwRJd'></legend><bdo id='QwRJd'><pre id='QwRJd'><center id='QwRJd'></center></pre></bdo></b><th id='QwRJd'></th></span></q></dt></tr></i><div id='QwRJd'><tfoot id='QwRJd'></tfoot><dl id='QwRJd'><fieldset id='QwRJd'></fieldset></dl></div>

                    1. <legend id='QwRJd'><style id='QwRJd'><dir id='QwRJd'><q id='QwRJd'></q></dir></style></legend>