Bug 32214 - [iOS9] CNContact.ContactRelations should return CNLabeledValue[], not NSObject[]
Summary: [iOS9] CNContact.ContactRelations should return CNLabeledValue[], not NSObject[]
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.99 (iOS9 previews)
Hardware: PC Mac OS
: Normal normal
Target Milestone: 9.0 (iOS9)
Assignee: Bugzilla
URL:
: 32219 32676 ()
Depends on:
Blocks:
 
Reported: 2015-07-21 11:58 UTC by Larry O'Brien
Modified: 2015-09-14 14:28 UTC (History)
3 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:
VERIFIED FIXED

Description Larry O'Brien 2015-07-21 11:58:16 UTC
Calls to CNContact.ContactRelations return an array of type CNLabeledValue:

Relation:<CNLabeledValue: 0x13f549930: identifier=8A4C5D86-2AFC-40AF-8436-12FF4D3D0AB1, label=_$!<Spouse>!$_, value=<CNContactRelation: 0x13f549190: name=Tina Jensen>>
Comment 1 Larry O'Brien 2015-07-21 13:05:15 UTC
Also all of the following CNContact properties return CNLabeledValue[]:

ContactRelations
Dates
EmailAddresses
InstantMessageAddressese
PhoneNumbers
PostalAddresses
SocialProfiles
UrlAddresses
Comment 2 Sebastien Pouliot 2015-07-21 13:28:44 UTC
It's a known issue [1] that will be fixed later. NSObject is not perfect but the real solution is not yet supported by the binding generator/runtime, i.e. we need something like CNLabeledValue<T>


[1] https://trello.com/c/XU0FWCp3/504-objective-c-generics-more-specifically-cnlabeledvalue
Comment 3 Sebastien Pouliot 2015-07-21 13:30:27 UTC
*** Bug 32219 has been marked as a duplicate of this bug. ***
Comment 4 Sebastien Pouliot 2015-08-01 12:31:03 UTC
*** Bug 32676 has been marked as a duplicate of this bug. ***
Comment 5 Sebastien Pouliot 2015-09-03 14:06:43 UTC
Rolf added support for this 

It can be tested in maccore/xcode7-c5 7547e9fcc9e11697eaf7c6a5784a7290ac815a1c
Comment 6 Ram Chandra 2015-09-14 14:28:34 UTC
I have checked this issue with following builds:

Mac OS X 10.10.5
Xamarin Studio: 5.9.6 (build 65)
Mono 4.0.4 ((detached/cb6d6b2)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400040002
Xcode 7.0 (8223)
Build 7A218
Xamarin.iOS : 9.0.0.45 (Enterprise Edition)
=== Build Information ===
Release ID: 509060065
Git revision: d23bcf36c1aa3be6680180c221ecab75b4e76d7d
Build date: 2015-09-10 13:03:15-04
Xamarin addins: 8cc7a2cd76d30ad32e7afb5ce012acdbd27d71cc

I have checked the definition of "CNContact" class in assembly browser and observed that the following CNContact properties returns CNLabeledValue<T>[]:

ContactRelations
Dates
EmailAddresses
InstantMessageAddressese
PhoneNumbers
PostalAddresses
SocialProfiles
UrlAddresses

This issue has been fixed. Hence I am closing this issue.