Cocoa:拖放任何文件类型 [英] Cocoa: Drag and Drop any file type

查看:179
本文介绍了Cocoa:拖放任何文件类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个拖放区域,接受任何文件类型并将其上传到服务器(使用ASIHTTPRequest)。我看了下面的例子,苹果提供:

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.

这篇关于Cocoa:拖放任何文件类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆