地址字段不显示值

时间:2011-03-31 12:04:46

标签: iphone

虽然名称正在显示,但

地址字段未从webservice获得其值。 我使用ABPersonViewController看地址簿有。

NSString *strAddress = [[NSString alloc]initWithString:aBook.Address];
    ABRecordSetValue(person, kABPersonAddressProperty,strAddress, NULL);

帮助!

修改后的代码:

    ABMutableMultiValueRef multiAddress = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);
    NSMutableDictionary *addressDictionary = [[NSMutableDictionary alloc] init];
    [addressDictionary setObject:strAddress forKey:(NSString *) kABPersonAddressStreetKey];
    ABMultiValueAddValueAndLabel(multiAddress, addressDictionary, kABHomeLabel, NULL);
    ABRecordSetValue(person, kABPersonAddressProperty, multiAddress, NULL);
        CFRelease(multiAddress);

0 个答案:

没有答案