Re: AddressBook - ABMultiValue
Re: AddressBook - ABMultiValue
- Subject: Re: AddressBook - ABMultiValue
- From: Isaac Sherman <email@hidden>
- Date: Tue, 27 Aug 2002 14:46:14 -0400
on 8/27/02 2:20 PM, the method -(id)email@hidden:(id)
sender:@"Roarke Lynch"; returned:
>
On Tuesday, August 27, 2002, at 02:08 AM, Ben Mackin wrote:
>
>
> I have been working on adding Address Book support (10.2) to my app and
>
> everything is going great, except for one thing. I have been reading
>
> about
>
> this whole ABMultiValue thing, and thought I had gotten it. But when I
>
> try
>
> and use the following code:
>
>
>
> ABMultiValue *myValues;
>
> int myIndex;
>
>
>
> myValues = [[peopleFound objectAtIndex:0]
>
> valueForProperty:kABPhoneProperty];
>
> myIndex = [myValues indexForIdentifier:kABPhoneMainLabel];
>
> string = [myValues valueAtIndex: myIndex];
>
>
>
> I get an error that:
>
>
>
> -[NSCFArray objectAtIndex:]: index (2147483647) beyond bounds (2)
>
>
>
You are getting this error b/c myIndex points to garbage. You never
>
set a value for it, so it is reading whatever int interpreted value is
>
sitting at &myIndex.
Actually, he did. It looks to me like myIndex = [myValues
indexForIdentifier:kABPhoneMainLabel]; is returning a garbage value. Is
that error message consistent? Is the phone number 214-748-3647? Try
eliminating myIndex altogether by using string = [myValues valueAtIndex:
[myValues indexForIdentifier:kABPhoneMainLabel]] instead, and see where that
gets you.
HTH,
--
Isaac Sherman
MotaSoft Software
http://homepage.mac.com/huperzoevs/
_______________________________________________
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.