<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 访问库中的视频?

        Accessing Videos in library using AssetsLibrary framework iPhone?(使用 AssetsLibrary 框架 iPhone 访问库中的视频?)

          <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 访问库中的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  EAAccessory/EASession teardown during background(EAAccessory/EASession 在后台拆除)
                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  How to get indexPath.row of tableView which is currently being displayed?(如何获取当前正在显示的 tableView 的 indexPath.row?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)

                  <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>
                          <tbody id='QwRJd'></tbody>

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