I have a very simple application test in which I want to drag and drop files in a NSImageView object.
I can already get the list of files from this action, but now I want to store this data in an array to be accessed in the View using data bindings. The only code I have that works fine with data bindings, tough, has an array in AppDelegate that I access using an Array Controller. But then, my data is inside a class I created to the NSImageView called “DropView”, which extends “NSImageView” class and handles the drop action.
How can I pass the array information to make the bindings possible?
Any suggestion is welcome. Thanks!
I decided to use a singleton in a bigger project. In this smaller one I did like this:
1 – Add AppDelegate reference to the subclass (m file):
#import "AppDelegate.h"2 – Call a method declared in the AppDelegate passing all the information needed like this:
[[NSApp delegate] doSomething:someInformation];3 – Set all the information in the method used.
4 – Make the bindings in the interface.