Re: AddressBook - ABMultiValue
Re: AddressBook - ABMultiValue
- Subject: Re: AddressBook - ABMultiValue
- From: Roarke Lynch <email@hidden>
- Date: Tue, 27 Aug 2002 14:20:09 -0400
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.
Roarke Lynch
-------------------------------
email@hidden
_______________________________________________
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.