Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

查询 _File 表返回的对象强制转换成 AVFile 问题 #513

Open
SXiaoXu opened this issue Aug 8, 2018 · 1 comment
Open

查询 _File 表返回的对象强制转换成 AVFile 问题 #513

SXiaoXu opened this issue Aug 8, 2018 · 1 comment

Comments

@SXiaoXu
Copy link

SXiaoXu commented Aug 8, 2018

下面这样 query 查到的是 AVObject,没有转换为AVFile,像下面这样强转会崩溃报错找不到对象。

  AVQuery *query = [AVQuery queryWithClassName:@"_File"];
   [query findObjectsInBackgroundWithBlock:^(NSArray objects, NSError error) {
     
       AVFile *file =[objects firstObject];
        [file deleteWithCompletionHandler:^(BOOL succeeded, NSError * _Nullable error) {
        }];
    }];

使用的时候还需像下面这样转换一下。

        AVObject *obj =[objects firstObject];
        AVFile *file = [AVFile fileWithAVObject:obj];
        [file deleteWithCompletionHandler:^(BOOL succeeded, NSError * _Nullable error) {
        }];

不清楚 SDK 就是这样设计的,还是 SDK 的 Bug。 @zapcannon87

@zapcannon87
Copy link
Contributor

应该算是 bug,但是事情有些麻烦,冒然改动的话可能会引起兼容性的问题;该问题的优先级不高,后续 SDK 内部讨论后再定夺吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants