• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AddressBook problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: AddressBook problems
      • From: Vince DeMarco <email@hidden>
  • Prev by Date: how to determine pixel width of a string in a text field
  • Next by Date: Instantiate NSCell in IB?
  • Previous by thread: Re: how to determine pixel width of a string in a text field
  • Next by thread: Re: AddressBook problems
  • Index(es):
    • Date
    • Thread