Sorry for the late response, for some reason I wasn't notified via mail about your response. Here's there information you were asking for:
Code reproducing your issue:
#import "ViewController.h"
@import Contacts;
@import ContactsUI;
@implementation ViewController
CNContactPicker *contactPicker;
-(IBAction)buttonPressed:(id)sender {
contactPicker = [[CNContactPicker alloc] init];
contactPicker.delegate = self;
contactPicker.displayedKeys = @[CNContactPostalAddressesKey];
[contactPicker showRelativeToRect:NSZeroRect ofView:sender preferredEdge:NSRectEdgeMinY];
}
- (void)contactPicker:(CNContactViewController *)picker didSelectContactProperty:(CNContactProperty *)contactProperty {
CNPostalAddressFormatter *formatter = [[CNPostalAddressFormatter alloc] init];
NSString *formattedAddress = [formatter stringFromPostalAddress:contactProperty.value];
NSLog(@"Formatted Address:\n%@", formattedAddress);
@try
{
CNContactFormatter *contactFormatter = [[CNContactFormatter alloc] init];
NSString *formattedContact = [contactFormatter stringFromContact:contactProperty.contact];
NSLog(@"Formatted Contact:\n%@", formattedContact);
}
@catch(id anException)
{
NSLog(@"Exception:\n%@", anException);
}
}
@end
iOS version reproducing your issue:
This is not an iOS issue. It happens in AppKit on macOS Sonoma 14.6.1.
Does the issue also occur when using Xcode 16 beta 2?
I didn't test Xcode 16 Beta 2 but it also happens with the (more recent) Xcode 16.1 Beta
Topic:
App & System Services
SubTopic:
General
Tags: