• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ukraine Postal District in Address Book API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ukraine Postal District in Address Book API


  • Subject: Re: Ukraine Postal District in Address Book API
  • From: Vince DeMarco <email@hidden>
  • Date: Mon, 1 Dec 2003 20:48:24 -0800

On Dec 1, 2003, at 7:35 PM, Steve Sheets wrote:

Two issues..

First, I am using the new Address Book 10.3 API (Panther) with Project Builder (not XCode). I am mostly just using the 10.2 APIs, along with the new Property ID Strings (ex. Nickname, Middle Name).

To correctly display an international address, you look at the kABAddressCountryCodeKey, a 2 character identifier, that tells you what country the address is for. Using the Address Book as model, you can see other countries have different formats to displaying address (ex Address City State Zip Country vs Country Zip City Address vs Address Zip City Country). You get the idea. Several countries do not have the equivalent of states, so that field is not used.

However there is one country, Ukraine, that not only has City & State, but also has a Postal District field. If you set Address Book to display address from Ukraine, that field becomes editable. It is ONLY time you can enter/edit that field in Address Book AND the API provides no Property identifier to establish how to read that bit of information.

Yes, I can scan through an address entry, look for all property strings, and identify the unused one as Postal District. I have not done that yet. Or someone who created address book API could give me the missing property string.

The Address Format for the Ukraine adds a Region key to the dictionary. we currently only do this for Ukraine. So for now you
can just look to see if the value you get for an address should contain that key along with

extern NSString * const kABAddressProperty; // Street Addresses - kABMultiDictionaryProperty
extern NSString * const kABAddressStreetKey; // Street
extern NSString * const kABAddressCityKey; // City
extern NSString * const kABAddressStateKey; // State
extern NSString * const kABAddressZIPKey; // Zip
extern NSString * const kABAddressCountryKey; // Country
extern NSString * const kABAddressCountryCodeKey; // Country Code

We have a bug to add kABAddressRegionKey to the header file.

Secondly, I am writing an address book application that needs to run under both 10.2 & 10.3. I will only use 10.2 calls, however I need to access the 10.3 Properties globals, to look into a person address book entry (ex. to see his first name, middle name & last name). I am having problems linking the 10.3 Address Book Framework. It wants me to have all the 10.3 interfaces, not just address book. Even if I did that, the 10.3 globals would require 10.3 only. I do not know why the Properties are set as globals. Are they not constants?

The property for First name in an address book entry will always be the same? Otherwise, address books would not be forward compatible.

Yes the property for First name etc.. will always remain the same.

Know this, I am thinking of just hard coding the Properties strings that I need for the new 10.3 fields (ex. nickname, middle name, etc). Is there any problem with this?

This should work, as the values will not change, but i would suggest in your code to do something like this

#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED
Then use the constants from the header.
#else

#endif

This will only change compile, but at least it is documented to describe whats going on.

The other alternative is to use the CFBundle code to look up the property to see if it exists at runtime, You should be able to find how to do this by looking up the documentation for weak linking in the documentation.

vince
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Ukraine Postal District in Address Book API
      • From: Steve Sheets <email@hidden>
References: 
 >Ukraine Postal District in Address Book API (From: Steve Sheets <email@hidden>)

  • Prev by Date: Re: Strange NSStatusItem Bug
  • Next by Date: Semi-OT - shift-tab behavior broken for edit fields?
  • Previous by thread: Ukraine Postal District in Address Book API
  • Next by thread: Re: Ukraine Postal District in Address Book API
  • Index(es):
    • Date
    • Thread