Bug 1555 - Incorrect MKUserLocation class
Summary: Incorrect MKUserLocation class
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2011-10-19 04:18 UTC by Michal
Modified: 2011-11-28 11:59 UTC (History)
6 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Michal 2011-10-19 04:18:52 UTC
MonoTouch v5.0 is missing some bindings of MKUserLocation class:

1.       It is not derived from MKAnnotation
2.       Title has no setter
3.       Subtitle has no setter.
 
In previous MT (4.2.2) everything was fine.
 
From assembly browser:
4.2.2 
 
[Register ("MKUserLocation", true)]
public class MKUserLocation : MKAnnotation
{
                public virtual string Title { get; set; }
                public virtual string Subtitle { get; set; }
}
 
5.0
[Register ("MKUserLocation", true)]
public class MKUserLocation : NSObject
{
                public virtual string Title
                {
                                [Export ("title")]
                               get {}
                }
                public virtual string Subtitle
                {
                                [Export ("subtitle")]
                                get {}
                }
}
 
By apple’s MKUserLocation docs, MKUserLocation should conform to MKAnnotation as well as Title and Subtitle properties should have also setter (otherwise it is not possible to set them).
Comment 1 Jeffrey Stedfast 2011-10-19 10:50:23 UTC
Fixed in git, should be included in the next 5.0 release (5.0.1)
Comment 2 Dimitris Tavlikos 2011-11-02 04:08:24 UTC
MKUserLocation is incorrect, in version 5.0.1. There is no Coordinate property, which is included in MKAnnotation.
Comment 3 Jeffrey Stedfast 2011-11-02 11:51:34 UTC
Thanks Dimitiris. I've fixed this in git now.
Comment 4 Michal 2011-11-21 04:55:58 UTC
Reopened because MKMapView.ViewForAnnotation accepts MKAnnotation only, but not MKUserLocation, which conforms to MKAnnotation protocol.
Comment 5 Jeffrey Stedfast 2011-11-28 11:43:56 UTC
Miguel: Do you have any thoughts on this?

I'm thinking we'll have to change the API to take NSObjects instead of MKAnnotations.
Comment 6 Jeffrey Stedfast 2011-11-28 11:59:54 UTC
I've just fixed this in 5.0.x and 5.1.x branches (won't make it into 5.0.3 or 5.1.0 tho, too late for those releases)