Search code examples
iosxcodemapkitmkpolyline

App display error in iOS7 Xcode5 in MKPolyline


I am updating my old app to iOS7. In that app i am displaying line over map using MKPolyline. its working fine in iOS6 and Xcode 4.6 but doesnt work in my new xcode and displayed error on the codes of MKPolyline.

Is apple has change MapKit Framework. what should i have to update?

On the MKPolyline codes display this error

Unknown type name 'MKPolyline'

But if i Control-Click the MKPolyline than it will take me to the MapKit class.


Solution

  • First of all i think this is the problem with the #import code. You said that this is an old app. please show us the #import code for mapkit framework.

    If it like this:

    #import "MapKit/MKMapView.h"
    

    than change it to this:

    #import <MapKit/MapKit.h>
    

    I think this will solve the unknown class error. if still its display error than use MKGeodesicPolyline instead of MKPolyline. You can find nice explanation here.

    Hope it help.