• 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
Questions about the AddressBook APIs...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Questions about the AddressBook APIs...


  • Subject: Questions about the AddressBook APIs...
  • From: email@hidden
  • Date: Wed, 13 Dec 2006 11:52:29 -0600

So I recently wrote a simple foundation tool to remove overlapping contacts
defined by having the same email address b/w two different groups in
AddressBook. I make use of "sender member of group" in Mail.app's rules so
these groups have about 2000+ contacts each. Each contact is unique and all it
consists of it an email address. What I didn't understand what my program was
initially written to load the contents of all Persons from each group and then
use a nested loop to compare each email address for each contact. I observed
that memory simply grew and grew and grew. and this growing seemed to occur
when using an NSEnumerator to iterate of the NSArray comprising of a set of
Persons from each group.

Last night I rewrote the app to use separate autorelease pools such that I
initially loaded each set and then build an id->email address dictionary and
then threw away the NSArray of Persons for each group and then used
recordForUnqiueId when ever I had a match to load the ABPerson for the
overlapping contact and this seemed to be dramatically different in terms of
memory usage.

Q1. Why is it necessary to load a full Person when they have unique ids just to
delete it? see. ABAddressBook remove:

Q2. Why would iterating over each group in a nested fashion completely grow the
memory to in excess of 1gig? Note the final solution iterates over the
dictionary so the same about of enumeration still applies.




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Cocoa UI
  • Next by Date: Re: NSSplitView
  • Previous by thread: Re: NSSplitView
  • Next by thread: [MEET] LA CocoaHeads reminder : Meeting tomorrow, Dec 14
  • Index(es):
    • Date
    • Thread