Assignment 6 — Adding the MapKit Framework

I thought I’d take a moment to post about a problem a couple of people have been having. If you’re getting the following error, it is probably the result of not having added the MapKit framework…

*** Terminating app due to uncaught exception ‘NSInvalidUnarchiveOperationException’, reason: ‘*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (MKMapView)’

Under Xcode 3.2 (the screenshots in the notes) MapKit is pre-populated in the Add → Existing Frameworks… dialog and simply requires selecting MapKit from the list. However under Xcode 3.1 you have to do a bit more work. Follow the steps below for adding MapKit to your project if you haven’t done so already…

1) Open Finder and browse to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks as shown below (you may need to adjust the path a little if using a SDK newer than 3.0 with Xcode 3.1)…

Finder Window

Finder Window

2) Select the MapKit.framework fold and drag-and-drop it into the root of your Xcode project as shown below…

DnD Framework into Xcode

DnD Framework into Xcode

3) You should uncheck the box that states “Copy items into destination group’s folder (if needed)”, and press Add…

Copy Dialog

Copy Dialog

4) The MapKit framework should now appear under your project with the rest of the frameworks and your app should now contain the necessary MapKit libraries to run.

The Added Framework

The Added Framework

Advertisements

2 Responses to “Assignment 6 — Adding the MapKit Framework”

  1. James Says:

    Thank you indeed! Refreshingly simple fix!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: