I am new to mac osx app writing so i’m doing something with storyboard. i took an existing app source demo i found on the web and i’m modding it. i’ve learned quite a bit from playing with it on online searching but i haven’t found all i need.
much of the online help is for phone apps and doesn’t entirely transfer over.
others are old and obsolete.
here’s what i have so far.
i have a windowcontroller with a child viewcontroller which contains a tableview and a customised class derived from an image view. i am using this so i can customise drag and drop.
the table view in the sample has a deligate which reads from an array to populate the table. i can add, subtract, etc text items from the arran, call the tableview’s reloaddata() method and it populates the table. that bit works great.
what i want do to is when i drag an image onto my custom image view class is that it takes the filename of the image and add it to the table view of the parent.
one way i suppose i could do it is with shared data but that’s rather messy. a cleaner way would be for the child custom imageview to send an event to the parent and the parent handling the event. only i do not know how to do this. i saw something using protocols but that was for phones and wouldn’t transfer properly.
i’m using mac os montery and xcode 14.2
i found something on protocols which i copied, pasted and changed class names, hower some properties/methods were missing. most online code of this nature seems to be written for phones.
Frank Baron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.