• 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: (no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)


  • Subject: Re: (no subject)
  • From: Marc Blatt <email@hidden>
  • Date: Tue, 29 Jul 2003 21:18:41 -0700

OK, for those interested, my original implementation was based upon the design of the AddressBookCocoa sample code provided by the ADC. In that example, both methods created instances of the ABAddressBook independently as follows:

ABAddressBook *ab = [ABAddressBook sharedAddressBook];

Following this implementation worked for a couple of calls and then caused the following runtime error in my code:

*** Selector 'isKindOfClass:' sent to dealloced instance 0x1267150 of
class ABGroup.
Break at '-[_NSZombie methodSignatureForSelector:]' to debug.

After trying several retain and release variations from within my searchForGroup: method, I decided to declare an instance variable for the address book, initialize and retain it, and then release it from within dealloc:. This works perfect, no more deallocated instance of class ABGroup when calling this method multiple times. Not sure why the original implementation failed since, according to the API and the example, there is only on address book--logic should dictate that if you create an instance of the address book from within the method (with local vars), then each new search call should be independent of the last. It works now, that's all that matters...

Marc
_______________________________________________
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.

References: 
 >(no subject) (From: Marc Blatt <email@hidden>)

  • Prev by Date: Re: NSOutlineView -- How to find the last selected item
  • Next by Date: Re: Cron Job Utility or GUI for Mac OS X?
  • Previous by thread: (no subject)
  • Next by thread: Insert Services and Windows menu programmatically
  • Index(es):
    • Date
    • Thread