AddressBook problems
AddressBook problems
- Subject: AddressBook problems
- From: Hasan Diwan <email@hidden>
- Date: Fri, 14 Feb 2003 21:34:38 -0800
The code below generates a "*** Uncaught exception: <NSRangeException>
*** -[NSCFArray objectAtIndex:]: index (2147483647) beyond bounds
(1)"... And I can't see where the error is. Thanks in advance for the
help!
#import <AddressBook/AddressBook.h>
#import <Cocoa/Cocoa.h>
int main(int argc, char **argv) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *data = [[ABAddressBook sharedAddressBook] people];
NSEnumerator *i=[data objectEnumerator];
id rec;
while (rec = [i nextObject]) NSLog(@"%@\n", [[rec
valueForProperty:kABAddressProperty] valueAtIndex:[[rec
valueForProperty:kABAddressProperty]
indexForIdentifier:kABAddressStreetKey]]);
[pool release];
return 0;
}
Hasan Diwan
OpenPGP KeyID: 0x7EE3855B
Fingerprint: 42F0 5758 C3EB BA1F ABD2 ED49 3390 CCF0 7EE3 855B
http://www.cs.rpi.edu/~diwanh/gpg.key
[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
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.