i have some instance methods implemented in a class to do some 2D painting; and the image is rendered into a view declared in my paintViewController.
these methods (like clearImage, changeBrushColor) are fully working if i call them from code generated buttons inside the same class.
but what i want is to use the UIkit to make all the graphic, buttons ecc and just an empty view to paint in.
i've tried some ways to call instance methods from other classes but none of them seems to be working..
can someone explain to me step by step how to do this?
These are the ways i've already tried:
in
PaintViewController.m
I#import "Paint.h"
then call the erase method like this- (IBAction)eraseButton:(id)sender { Paint *newInstance = [[Paint alloc]init]; [newInstance clearImage]; }
it is like the method is called but not working.. (if i put an NSLog inside the method it prints stuff)
i
@class Paint
inside myPaintViewController.h
, set the property in interface as@property (strong, nonatomic) Paint *paint;
and inside the IBAction i write[self.class clearImage];
this is not working at all.