ABMultiValueCopyValueAtIndex gives message sent to deallocated instance
<p>HI ,</p>

<pre><code>I am getting a issue when trying to access the kABPersonInstantMessageProperty. The code is as follows :

    ABMultiValueRef IMS = ABRecordCopyValue(record, kABPersonInstantMessageProperty);
CFRetain(IMS);
if(IMS)
{
    int IMSCount = ABMultiValueGetCount(IMS);
    MWLOG(5, @"**** IMS COunt **** : %d", IMSCount);
    for(int iIM =0; iIM &lt; IMSCount; ++iIM)
    {
        MWLOG(5, @"index *** : %d", iIM);
        CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(IMS, iIM);
        NSString* label = (NSString*)ABMultiValueCopyLabelAtIndex(IMS, iIM);

        NSString* service= (NSString*)CFDictionaryGetValue(dict, kABPersonInstantMessageServiceKey);
        NSString* username= (NSString*)CFDictionaryGetValue(dict, kABPersonInstantMessageUsernameKey);

        if(label) CFRelease(label);
        if(service) CFRelease(service);
        if(username) CFRelease(username);
        if(dict) CFRelease(dict);
    }

    CFRelease(IMS);
}
</code></pre>

<p>But I am getting the following error in console :</p>

<pre><code>2010-03-13 12:39:16.731 mwp[1464:4f0b] *** -[CFString retain]: message sent to deallocated instance 0x1582820

2010-03-13 12:49:12.219 mwp[1464:4f0b] *** -[CFString _cfTypeID]: message sent to deallocated instance 0x15f0bf0
</code></pre>

<p>The stacktrace in the debugger is as follows :</p>

<pre><code>**#0    0x3026e017 in ___forwarding___

**#1    0x3024a0a2 in __forwarding_prep_0___**

**#2    0x30201368 in CFRetain **

**#3    0x325bdb6d in ABCCopyDictionaryWithTypes**

**#4    0x325bdbe3 in ABCMultiDictionaryCreateCopy**
</code></pre>

<ul>
<li>Is that the issue is with the api. I searched in the net but could nt find any solutions.</li>
</ul>

<p>I am getting this issue only in reading the InstantMessageProperty.  </p>

<p>Any help would be greatly appreciated ....</p>

<p>Best Regards,</p>

<p>Mohammed Sadiq.</p>
