-1

Well, i try to explain my problem:

  1. I sub-classed MyMapView from GMSMapView

    @interface MyMapView : GMSMapView @end

  2. Now i use MyMapView in MyViewController.m to show up a GMSMap and setup the delegate GMSMapViewDelegate.

    @implementation MyViewController IBOutlet MyMapView *mapView; }

    -(void)viewDidLoad { [super viewDidLoad]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6]; mapView = [MyMapView mapWithFrame:CGRectZero camera:camera]; self.view = mapView; mapView.delegate = self; }

  3. In MyViewController.h i declared the GMSMapViewDelegate

    @interface MyViewController : UIViewController <GMSMapViewDelegate> @end

Now i want to use some GMSMapViewDelegate-Methods in MyViewController but all i tried went wrong. Can anyone explain me how to use the GMSMapViewDelegate-Methods in this scenario?

Thanks, grethi.

grethi
  • 146
  • 11
  • I may have found a solution here [delegate-after-subclassing](http://stackoverflow.com/questions/8389142/delegate-after-subclassing). After I tried it I will give feedback. – grethi Sep 17 '14 at 08:15

1 Answers1

0

So i solved the problem by adding the delegate to the subclass AND to the view controller

@interface MyMapView : GMSMapView <GMSMapViewDelegate>
@end

@interface MyViewController : UIViewController <GMSMapViewDelegate>
@end

After this you can use the delegate-methods in the view controller.

grethi
  • 146
  • 11