Re: AddressBook & phone multivalue
Re: AddressBook & phone multivalue
- Subject: Re: AddressBook & phone multivalue
- From: Sheehan Olver <email@hidden>
- Date: Sat, 9 Nov 2002 15:03:57 -0600
I have the following method that seems to work fine:
-(ABMultiValue *)phoneNumbers
{
return [self valueForProperty:kABPhoneProperty];
}
Note the use of ABMultiValue instead of ABMutableMultiValue. I don't
know how Objective-C handles casting an object to the wrong type,
perhaps it causes it to be nil? If you want to change it, do the
following:
ABMutableMultiValue *updated;
updated = [[self phoneNumbers] mutableCopy];
... do changes ...
[self setValue:updated forProperty:kABPhoneProperty];
[[ABAddressBook sharedAddressBook] save];
Hopefully the colors didn't mess up the code, I've had some problems
with ProjectBuilder colors when copying into email.
On Saturday, November 9, 2002, at 12:00 AM,
email@hidden wrote:
>
Message: 3
>
From: "T G" <email@hidden>
>
To: email@hidden
>
Subject: AddressBook & phone multivalue
>
Date: Fri, 08 Nov 2002 21:46:27 +0000
>
>
Hi all,
>
>
I'm having trouble with phone numbers & the AddressBook. Specifically,
>
when
>
I try to retreive the phone numbers for a given person, I get no data,
>
regardless of the fact that the contact in question definitely has at
>
least
>
one phone number.
>
>
Here's how I'm doing it... (where person is of type ABPerson *)
>
>
ABMutableMultiValue *phone;
>
//...
>
phone = [person valueForProperty:kABPhoneProperty];
>
//...
>
>
phone is always nil. :(
>
>
Has anyone else encountered this? Or is it just something really basic
>
that
>
I've managed to overlook?
>
>
Thanks,
>
>
Terence
_______________________________________________
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.