tags:

views:

44

answers:

1

I have a view controller with this code on the ViewDidLoad...

UIImage *imageU = [[UIImage alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"transparent" ofType:@"png"]];
TouchImageView *transparent = [[TouchImageView alloc] initWithImage:imageU];
[transparent setUserInteractionEnabled: YES];
[transparent setMultipleTouchEnabled: YES];
[self.view addSubview:transparent];


imageU = [[UIImage alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"pointer" ofType:@"png"]];
myPointer = [[UIImageView alloc]initWithImage:imageU];
[myPointer setUserInteractionEnabled: YES];
myPointer.center = CGPointMake(160, 240);
[self.view addSubview: myPointer];

as you see transparent's class is TouchImageView that is a subclass of UIImageView.

what I need is, events generated inside TouchImageView class must control the position of "pointer", and this is an object outside the scope of the class.

as you see, both transparent and pointer are on the same level hierarchically.

How do I refer to pointer inside TouchImageView class?

the line I am trying to make work is

self.superview.myPointer.transform = CGAffineTransformConcat(originalTransform, incrementalTransform);

but it says myPointer is something not a structure or union...

+1  A: 

try making myPointer an instance variable of the TouchImageView class

ennuikiller
thanks! That helped!
Digital Robot
glad to have helped!
ennuikiller