可可:拖放任何文件类型 [英] Cocoa: Drag and Drop any file type
问题描述
我正在尝试创建一个接受任何文件类型的拖放区域,并将其上传到服务器(使用ASIHTTPRequest)。我查看了Apple提供的以下示例:
I'm trying to create a drag and drop region that accepts any file type and will upload it to a server (using ASIHTTPRequest). I looked at the following example that Apple provides:
http://developer.apple.com/library/mac/#samplecode/CocoaDragAndDrop/Introduction/Intro.html
,但它只涵盖处理图像的拖放。如何设置我的拖放操作来处理任何文件类型?
but it only covers dealing with the dragging and dropping of images. How can I set up my drag and drop operations to deal with any file type?
谢谢。
推荐答案
根据发布,您可能会只需要将您的视图注册为 NSFilenamesPboardType
而不是 imagePastBoardTypes
来接收任意文件类型。
Judging by this post, you'd probably just have to have your view register for NSFilenamesPboardType
instead of the imagePastBoardTypes
to receive arbitrary file types.
这篇关于可可:拖放任何文件类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!