Re: (no subject)
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.