title: How to get a CNContact phone number(s) as string in Xamarin.ios?
body: <p>I am attempting to retrieve the names and phone number(s) of all contacts and show them into tableview in Xamarin.iOS. I have made it this far:</p>
  
  <pre><code> var response = new List&lt;ContactVm&gt;();
              try
              {
                  //We can specify the properties that we need to fetch from contacts  
                  var keysToFetch = new[] {
              CNContactKey.PhoneNumbers, CNContactKey.GivenName, CNContactKey.FamilyName, CNContactKey.EmailAddresses
              };
                  //Get the collections of containers  
                  var containerId = new CNContactStore().DefaultContainerIdentifier;
                  //Fetch the contacts from containers  
                  using (var predicate = CNContact.GetPredicateForContactsInContainer(containerId))
                  {
                      CNContact[] contactList;
                      using (var store = new CNContactStore())
                      {
                          contactList = store.GetUnifiedContacts(predicate, keysToFetch, out
                              var error);
                      }
                      //Assign the contact details to our view model objects  
                      response.AddRange(from item in contactList
                                        where item?.EmailAddresses != null
                                        select new ContactVm
                                        {
                                            PhoneNumbers =item.PhoneNumbers,
                                            GivenName = item.GivenName,
                                            FamilyName = item.FamilyName,
                                            EmailId = item.EmailAddresses.Select(m =&gt; m.Value.ToString()).ToList()
                                        });
  
  
  
                  }
  
  
                  BeginInvokeOnMainThread(() =&gt;
                  {
                      tblContact.Source = new CustomContactViewController(response);
                      tblContact.ReloadData();
  
                  });
              }
  
              catch (Exception e)
              {
                  Console.WriteLine(e);
                  throw;
              }
  </code></pre>
  
  <p>and this is my update cell method</p>
  
  <pre><code> internal void updateCell(ContactVm contact)
          {
              try
              {
  
                  lblName.Text = contact.GivenName;
                  lblContact.Text = ((CNPhoneNumber)contact.PhoneNumbers[0]).StringValue;
  
                  //var no = ((CNPhoneNumber)contact.PhoneNumbers[0]).StringValue;
                  //NSString a = new NSString("");
                  // var MobNumVar = ((CNPhoneNumber)contact.PhoneNumbers[0]).ValueForKey(new NSString("digits")).ToString();
  
                  var c = (contact.PhoneNumbers[0] as CNPhoneNumber).StringValue;
              }
              catch(Exception ex)
              {
                  throw ex;
              }
  
  
          }
  </code></pre>
  
  <p>I would like to know how to retrieve JUST the phone number(s) as a string value(s) i.e. "XXXXXXXXXX". Basically, how to call for the digit(s) value. 
  this line of code</p>
  
  <pre><code>lblContact.Text = ((CNPhoneNumber)contact.PhoneNumbers[0]).StringValue;
  </code></pre>
  
  <p>throw a run time exception as <strong>specified cast is not valid</strong></p>