开发者

Cocoa search files anywhere

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜