Question

I have a toolbar object that inherits from UIView and is a subview of "CanvasView" on the bottom of the screen on an iPad app.

Basically I have buttons on this subview that should draw an image onto CanvasView, it's superview. I have tried many different things but nothing draws the image and I don't ever get errors to tell me what I am doing wrong.

Are there any permissions I need to give my toolbar so that it can draw on the view?

many thanks in advance

Was it helpful?

Solution

As PengOne said, it was definitely a delegation issue. If you have a view controller that owns another class, and you want to access a method in the view controller from that class you need to set the view controller as a delegate of the class (Please correct me if I'm getting the terminology wrong). Anyway, the code works perfectly now thanks to this site:

http://www.ios-developer.net/iphone-ipad-programmer/development/delegates/how-to-create-a-delegate

And thank you PengOne for the starting point!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top