ファイルにオーバーレイ アイコンを設定するために、Finder 拡張機能を使用して Cocoa アプリケーションを開発しています。
ユーザーが監視しているフォルダーをクリックするとすぐに、メソッドが呼び出されます- beginObservingDirectoryAtURL:
だから私のコードは次のとおりです。
- (void)beginObservingDirectoryAtURL:(NSURL *)url {
// The user is now seeing the container's contents.
// If they see it in more than one view at a time, we're only told once.
NSLog(@"Current Path : %@", url.path);
NSArray<NSString*>* children = [[NSFileManager defaultManager] subPathsAtPath:url.Path];
}
[[NSFileManager defaultManager] subPathsAtPath:…]
nil
Finder 拡張機能から呼び出されると返されます。
同じパスで同じメソッドを呼び出すと、メイン アプリの要素が返されます。
どうにかして Finder 拡張機能から特定のフォルダーを監視できるようにすることはできますか?