I need some help to get this right, please. I have created an iPad drawing app using a view controller (MainViewController) and a Custom Class which contains all the drawing code (DrawView.m). The DrawView class is implemented on an UIView view and the program works absolutely fine allowing to draw with finger touches. Erasing the drawing is accomplished by tapping a few times in sequence.
Now I would like to add more functionality (such as erasing the drawing and enabling undo and redo) by implementing some buttons.
The problem is that despite having declared an outlet for the drawing in my DrawView class (UIImageView *drawImage) I cannot find a way of physically connect this outlet in interface builder to the graphic interface (MainViewController_iPad.xib).
Is there a way I can connect them please? Thanks!!
I get the results that I think you’re looking for by the following steps:
MainViewController_iPadtargeted for iPad and with a matching xib file.UIViewsubclass calledDrawView.@property (nonatomic, strong) IBOutlet UIImageView *drawImage;and synthesize the variable.UIViewand aUIImageViewinto my xib file.UIViewtoDrawViewusing the identity inspector.DrawViewstill selected change to the connections inspector.drawImageoutlet to theUIImageViewobject.Is there something in that different from what you’re doing or am I missing a point in the question?