• 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: Addressbook api
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Addressbook api


  • Subject: Re: Addressbook api
  • From: Bill Cheeseman <email@hidden>
  • Date: Fri, 06 Sep 2002 08:03:22 -0400

on 02-09-05 4:38 PM, Henri Lamiraux at email@hidden wrote:

> NSNumber *intProperty = [NSNumber numberWithInt: kABIntegerProperty];
> NSDictionary *newProperty = [NSDictionary dictionaryWithObjectsAndKeys:
> intProperty, kMyProperty, nil, nil];
> int numberOfPropertiesAdded = [ABPerson addPropertiesAndTypes:
> newProperty];
> if (numberOfPropertiesAdded != 1) { // I added one property
> NSLog(@"Something went wrong");
> }

Are you sure about this?

1. You're saying that Cocoa programmers using the Cocoa Address Book
framework are responsible for converting the Address Book constants (like
kABIntegerProperty) into NSNumber objects themselves for purposes of adding
a property to a person? This isn't handled by the Cocoa Address Book APIs?
Shouldn't it be?

2. You're saying that, in this case, NSDictionary's
dictionaryWithObjectsAndKeys class method requires two trailing nils? (From
the NSDictionary documentation: "dictionaryWithObjectsAndKeys: takes a
variable number of arguments: a null-terminated list of alternating objects
and keys. If any key is nil, an NSInvalidArgumentException is raised.") I
think you want a single trailing NULL there.

Just trying to understand how this works. I've only glanced once at the
Address Book documentation, but I plan to get into it more deeply shortly.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
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: Addressbook api
      • From: Henri Lamiraux <email@hidden>
References: 
 >Re: Addressbook api (From: Henri Lamiraux <email@hidden>)

  • Prev by Date: undo text in an NSTextView
  • Next by Date: Re: cString deprecated!
  • Previous by thread: Re: Addressbook api
  • Next by thread: Re: Addressbook api
  • Index(es):
    • Date
    • Thread