coordinateAccessWithIntents& stopAccessingSecurityScopedResource

时间:2016-04-23 01:38:14

标签: ios icloud nsurl nsfilecoordinator

我在startAccessingSecurityScopedResource之后调用coordinateAccessWithIntents。在byAccessor块中,我应该在原始URL或可能更新的URL上调用stopAccessingSecurityScopedResource吗?

例如......

NSFileAccessIntent *readingIntent = [NSFileAccessIntent readingIntentWithURL:myURL options:0];
[fileCoordinator coordinateAccessWithIntents:@[readingIntent] queue:queue byAccessor:^(NSError * _Nullable error) {

    // stop the original url?
    [myURL stopAccessingSecurityScopedResource];

    // or the potentially updated url?
    [readingIntent.URL stopAccessingSecurityScopedResource];
}];

我应该在哪个URL上调用stopAccessingSecurityScopedResource?

0 个答案:

没有答案