简体   繁体   中英

Problem with file drag-and-drop in Cocoa

I'm experiencing some difficulties here.

I have a drop zone (custom view) with it's own class. Everything works great so far with it. The problem is that I can't get the result from the drop operation outside the class of the drop zone. I read everything I found in the net.

For instance, I would like my drop zone to count the lenght of the Array with the objects (files) dropped and set this number to a NSTextField. I know how to count the array, I don't know how to get this value and set it to the text field.

将数组发送到您的控制器(最有可能的方法是让您的拖放区视图的标头声明一个委托协议,并给拖放区视图本身一个委托属性,并让控制器遵循该协议并将其自身指定为该委托),以及让您的控制器将计数发送到文本字段。

I'm really confused. I got the idea with sending the array to the controller. Maybe my english is too poor to deal with the whole explanation. I really won't bother anyone so only who want, please take a look at my test project. DOWNLOAD 2MB+

It should be great if you leave some comments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM