0

マップ上のマーカーからイベントを取得しようとしています。mapView を保持する MainViewController 内のコードの一部を次に示します。

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から継承しRMMarker、次に から継承しCALayerます。プロパティはlabel基本的に UIView です。

問題は、 からの信号が得られないことですDoSomething

どんな助けでも大歓迎です。
ありがとう!

4

1 に答える 1

0

解決済み:

https://github.com/dguerri/route-me/commit/8dc751724a2b231c2b26dde93c94bd607509da27#L1R192

これには、RouteMe から欠落しているすべてのコードが含まれています。

于 2012-06-25T11:03:30.427 に答える