1

To implement mapView i tried adding <#import and MKMapViewDelegate and tried

And Here is my code:

- (void)viewDidLoad
{
    mapView = [[MKMapView alloc]initWithFrame:CGRectMake(0, 0, 320, self.view.frame.size.height - 90)];
    mapView.showsUserLocation = YES;
    mapView.mapType = MKMapTypeHybrid;
    mapView.delegate = self;
    [self.view addSubview:mapView1]; 
    [super viewDidLoad];
}

Undefined symbols for architecture i386: "_OBJC_CLASS_$_MKMapView", referenced from: objc-class-ref in maptryViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

What is the mistake i have done >?

2 Answers2

5

You include the header, so you can compile your code, but you are not linking the binary library, so you can't complete the build process. In your target settings, go to Build Phases and in the "Link with binary libraries" section, add MapKit.framework . Please check the screenshot below.

enter image description here

Vivek Molkar
  • 3,910
  • 1
  • 34
  • 46
The dude
  • 7,896
  • 1
  • 25
  • 50
1

If you're on Xcode 5, you can use @import MapKit instead, and you don't need to link against the library manually as LLVM Modules takes care of it for you.

Community
  • 1
  • 1
RyanR
  • 7,728
  • 1
  • 25
  • 39