I am trying to get events from the markers on the map. Here's some of the code inside the MainViewController that holds mapView.
UIImage* labelView = [self snapshotImage:theView];
UIImageView *imageView=[[UIImageView alloc]initWithImage:labelView];
CGRect rect=CGRectMake(0,0,imageView.image.size.width,imageView.image.size.height);
MyRMView *myrm = [[MyRMView alloc]initWithFrame:rect];
UIButton *sens = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[sens addTarget:self
action:@selector(DoSomething:)
forControlEvents:UIControlEventTouchUpInside];
sens.frame = rect;
[myrm addSubview:imageView];
[myrm addSubview:sens];
MyRMMarker* newMarker = [[MyRMMarker alloc] initWithUIImage:nil anchorPoint:CGPointMake(0.0, 1.0)];
newMarker.label = myrm;
MyRMMarker
inherits from RMMarker
which in turn inherits from CALayer
.
the label
property is a UIView essentially.
Problem is, I am not getting any signals from DoSomething
.
Any help will be appreciated alot.
Thanks!