【问题标题】:Setting NSFileBusy attribute in iOS在 iOS 中设置 NSFileBusy 属性
【发布时间】:2012-01-11 04:06:44
【问题描述】:

有没有人让 NSFileBusy 工作?使用下面的测试,它不起作用:

NSString* filePath = @"test.txt";
NSError* err = NULL;
NSDictionary* dic = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:TRUE] forKey:NSFileBusy];
BOOL res = [[NSFileManager defaultManager] setAttributes:dic ofItemAtPath:filePath error:&err];
dic = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:&err];
NSLog(@"File Busy %@", [dic objectForKey:NSFileBusy]);

调试显示 'err' 在两次调用中都为 null,setAttributes 的结果为 true,并且键 'NSFileBusy' 根本不在属性字典中。寻找一些示例实现,但找不到。如果有人能指出正确的信息或示例,将不胜感激。

【问题讨论】:

    标签: ios file nsfilemanager


    【解决方案1】:

    迟到了,但仍然如此:iOS 没有 NSFileBusy,因为它不应该像 Finder 那样具有图形文件表示:所有内容都在应用程序中进行沙盒处理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 2017-08-29
      相关资源
      最近更新 更多