1
我試圖從iOS上現有的AddressBook
聯繫人獲取即時消息帳戶信息。我瀏覽聯繫人並獲得具有即時消息傳遞價值的聯繫人,但我無法閱讀jabber地址。從ABRecordRef檢索即時消息信息
abArray = (NSArray *)ABAddressBookCopyArrayOfAllPeople(ABAddressBookCreate());
for(int i=0 ; i<[abArray count];i++)
{
ABRecordRef record = [abArray objectAtIndex:i];
ABMutableMultiValueRef multi = ABRecordCopyValue(record, kABPersonInstantMessageProperty);
for(CFIndex x=0;x<ABMultiValueGetCount(multi);x++)
{
CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(multi, x);
CFStringRef jabber = CFDictionaryGetValue(dict, kABPersonInstantMessageServiceJabber);
if(CFDictionaryContainsKey(dict, kABPersonInstantMessageServiceJabber))
{
NSLog(@"yes");
}
else {
NSLog(@"no");
}
// only to make it possible to log to console
NSString *jaab = (NSString *)jabber;
NSLog(@"jabber adress: %@" , jaab);
}
CFRelease(dict);
}
}
我在做什麼錯?
「我通過觸點走,我得到它在IM中的條目接觸,但我無法讀取的jabber地址。」爲什麼不呢?會發生什麼呢? – 2010-03-26 09:05:18