Bug 3117 - exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView' - solution wire it up to an instance variable
Summary: exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instanti...
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: General (show other bugs)
Version: 5.2
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
: 13561 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-27 14:27 UTC by Gerry
Modified: 2016-02-08 18:00 UTC (History)
4 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Gerry 2012-01-27 14:27:00 UTC
If you have a Mapview control to a view but do not wire up an instance variable to it you'll get a runtime crash on the device as shown:

exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView'

The workaround is to just wire up an instance variable to the control in the NIB.  I guess at that point mono touch realizes it needs to link in the map kit library.

I realize most people will want to hook up the variable but when you are initially laying out your screen you may not do this and then get the above crash and waste a lot of time tracking it down.
Comment 1 Miguel de Icaza [MSFT] 2012-02-01 16:32:31 UTC
Hello Gerry,

This is a good suggestion;   We will have to update our linker to reference frameworks that are listed on XIB files, even if they are not referenced in the code.
Comment 2 David Tavárez 2013-06-21 17:16:40 UTC
MMmmm... Still with the same problem. Is this closed?

(iPhone 3GS with iOS 6.03)
Comment 3 Rolf Bjarne Kvinge [MSFT] 2013-07-31 12:30:34 UTC
*** Bug 13561 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.