Eddie,
I think that all sounds great in theory and the right way, but everytime I try that, its back to the error. For example I define it in the viewcontroller, and then try this instead:
Header :
Code:
#import <UIKit/UIKit.h>
@class MainViewController;
@interface MainView : UIView {
UIImage *myUIImage;
MainViewController *mvc;
}
@property (nonatomic, retain) UIImage *myUIImage;
@property (nonatomic, retain) MainViewController *mvc;
@end
Methods:
Code:
#import "MainView.h"
#import "MainViewController.h"
#import <QuartzCore/QuartzCore.h>
@implementation MainView
@synthesize myUIImage, mvc;
- (void)drawRect:(CGRect)rect {
NSLog(@"drawRect go");
myUIImage = [UIImage imageNamed:mvc.imagePath]; // Code breaks here
NSLog(@"drawRect go again"); // This never runs