开发者

Associating a type of the folder with a cocoa app

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜