I am an objective C newb and relative programming novice in general, so your patience is appreciated. Inside a View Based Application template I am pulling this code out of myNameViewController.m and trying to insert it into a custom class. Everything transitions fine except this: [self.view addSubview:myImage]; I gather this is now calling the addSubview method of myObject, which does not exist....what is the correct way to insert the subview into the current view?
#import "myObject.h"
@implementation myObject
-(void)drawImage{
CGRect myImageRect = CGRectMake(0.0f, 0.0f, 70.0f, 70.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:@"test.png"]];
myImage.opaque = YES;
[self.view addSubview:myImage];
}
@end