开发者

Problem with file drag-and-drop in Cocoa

开发者 https://www.devze.com 2023-01-16 06:38 出处:网络
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 oper

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.


Send the array to your controller (most probably by having your drop-zone view's header declare a delegate protocol and giving the drop-zone view itself a delegate property, and having the controller conform to that protocol and appoint itself as that delegate), and have your controller send the count 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.

0

精彩评论

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

关注公众号