I am currently have trouble trying to understand how to access objects in an NSArrayController in conjunction with a NSCollectionView.
I have a class entitled: "VCMovieObjects", which contains information on a specific video clip. These objects are loaded into an NSArrayController, which is bound to a NSCollectionView. The NSCollectionView loads up my own subclassed NSViews (VCMovieContainer) into its contents for each object in the NSArrayController. I know I can bind various labels on my subclassed NSView to show the properties stored in my VCMovieObjects, but I want my VCMovieContainer to be able to access the appropriate VCMovieObject itself in the code, that way I can access all the data I need from it and use it appropriately when drawing the contents of the VCMovieContainer that correlates to that specific VCMovieObject.
I am not sure about how to go about doing this in the correct way. I consider trying to bind an NSObjectController to the NSArrayController, and then creating an Outlet to that object from my custom NSView, but I don't know if it will maintain the correct reference to the right object that coressponds with the particular view. When I tried it, I just got a null when trying to access data. I want to avoid subclassing NSArrayController if possible. Any pointers would be appreciated. Thank you.
I have a class entitled: "VCMovieObjects", which contains information on a specific video clip. These objects are loaded into an NSArrayController, which is bound to a NSCollectionView. The NSCollectionView loads up my own subclassed NSViews (VCMovieContainer) into its contents for each object in the NSArrayController. I know I can bind various labels on my subclassed NSView to show the properties stored in my VCMovieObjects, but I want my VCMovieContainer to be able to access the appropriate VCMovieObject itself in the code, that way I can access all the data I need from it and use it appropriately when drawing the contents of the VCMovieContainer that correlates to that specific VCMovieObject.
I am not sure about how to go about doing this in the correct way. I consider trying to bind an NSObjectController to the NSArrayController, and then creating an Outlet to that object from my custom NSView, but I don't know if it will maintain the correct reference to the right object that coressponds with the particular view. When I tried it, I just got a null when trying to access data. I want to avoid subclassing NSArrayController if possible. Any pointers would be appreciated. Thank you.