开发者

Cocoa search files anywhere

开发者 https://www.devze.com 2023-03-05 18:17 出处:网络
Is there a way I can tag a file on the hard drive, and basically, after the user moves it, the OS keeps track of the file, so when I want to access i开发者_如何学Pythont again, I just specify the tag

Is there a way I can tag a file on the hard drive, and basically, after the user moves it, the OS keeps track of the file, so when I want to access i开发者_如何学Pythont again, I just specify the tag and it tells me the location? I know that I can scan through the entire HD but that would take too long... Thanks.


if you are not supporting 10.5, but 10.6 and beyond, you might look at NSURL's

 - (NSData *)bookmarkDataWithOptions:(NSURLBookmarkCreationOptions)options includingResourceValuesForKeys:(NSArray *)keys relativeToURL:(NSURL *)relativeURL error:(NSError **)error

using the NSURLBookmarkCreationOption of:

NSURLBookmarkCreationPreferFileIDResolution

resolves the url using the fileID.

0

精彩评论

暂无评论...
验证码 换一张
取 消