0

This is my view controller that I implemented in the UIView.

The line that the compiler highlights in yellow is this:

self.vermapa_.delegate=self;

So is something wrong with self?

(.h)

#import <UIKit/UIKit.h>

@interface appiOSViewController : UIViewController

@end

and the (.m)

#import "appiOSViewController.h"
#import <GoogleMaps/GoogleMaps.h>
@interface appiOSViewController ()
@property (weak,nonatomic) IBOutlet GMSMapView *vermapa_;
@end

@implementation appiOSViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    **self.vermapa_.delegate=self;**

    GMSCameraPosition *pos = [GMSCameraPosition cameraWithLatitude:7.114797
                                                         longitude:-73.104932
                                                              zoom:15.3];

    self.vermapa_ = [GMSMapView mapWithFrame:CGRectZero camera:pos];
    self.vermapa_.myLocationEnabled = YES;
    self.vermapa_.settings.compassButton = YES;
    self.vermapa_.settings.myLocationButton = YES;
    self.vermapa_.settings.zoomGestures = YES;


    GMSMarker *marker = [[GMSMarker alloc] init];
    marker.position = CLLocationCoordinate2DMake(7.116309,-73.105713);
    marker.title = @"Parada frente al edificio L";
    marker.snippet = @"UNAB - Jardín";
    marker.map = self.vermapa_;

    GMSMarker *marker1 = [[GMSMarker alloc] init];
    marker1.position = CLLocationCoordinate2DMake(7.112412,-73.105134);
    marker1.title = @"CSU";
    marker1.snippet = @"UNAB - Terrazas";
    marker1.map = self.vermapa_;

    GMSMarker *marker2 = [[GMSMarker alloc] init];
    marker2.position = CLLocationCoordinate2DMake(7.110863,-73.106075);
    marker2.title = @"Parada de Bus - Terrazas";
    marker2.snippet = @"Terrazas";
    marker2.map = self.vermapa_;

    GMSMarker *marker3 = [[GMSMarker alloc] init];
    marker3.position = CLLocationCoordinate2DMake(7.117738,-73.105651);
    marker3.title = @"Parqueadero UNAB";
    marker3.snippet = @"UNAB - Jardín";
    marker3.map = self.vermapa_;


    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
anch95
  • 1
  • I solved my problem with the highlighted line with this: vermapa_.delegate=(id)self; But the UIView continiue showing the standard map, please i need your help from someone – anch95 Jun 21 '14 at 02:01

1 Answers1

0

You should do that:

@interface appiOSViewController () <GMSMapViewDelegate>

If you will be a delegate for some object, you should tell the class that you will implement delegate methods.

Oleg Sobolev
  • 3,286
  • 2
  • 16
  • 29