开发者

Associating a type of the folder with a cocoa app

开发者 https://www.devze.com 2023-04-12 17:13 出处:网络
I\'m writing an app that requires a folder to be opened with it. I\'d like to see if a folder can be dragged onto the app icon (in the dock, for instance) and the ap开发者_Python百科p to recognise it

I'm writing an app that requires a folder to be opened with it.

I'd like to see if a folder can be dragged onto the app icon (in the dock, for instance) and the ap开发者_Python百科p to recognise it as a valid type to open. How can I associate in xcode the folder type to my app, via the list of UTIs?

Thanks in advance.


Found the solution in the form of:

(a) editing the Info.plist file with an UTI entry for public.folder,

(b) overriding the function application:openFile: in my implementation of NSApplicationDelegate.

All works now.

0

精彩评论

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