Note that there are some explanatory texts on larger screens.

plurals
  1. PONSArray problem with addressbook
    primarykey
    data
    text
    <p>I have implemented an addressbook, I don't know what I do wrong, but whenever I select an address my whole app crashes and i receive the error</p> <pre><code>&gt; 2010-10-21 11:57:13.922 ANWB[2989:207] &gt; *** Terminating app due to uncaught exception 'NSRangeException', reason: &gt; '*** -[NSCFArray objectAtIndex:]: &gt; index (0) beyond bounds (0)' &gt; 2010-10-21 11:57:13.935 ANWB[2989:207] &gt; Stack: ( &gt; 843263261, &gt; 825818644, &gt; 842812211, &gt; 842812115, &gt; 862975761, &gt; 863130919, &gt; 110753, &gt; 870859136, &gt; 870898732, &gt; 870982260, &gt; 870977388, &gt; 844473760, &gt; 844851728, &gt; 862896011, &gt; 843011267, &gt; 843009055, &gt; 860901832, &gt; 843738160, &gt; 843731504, &gt; 9921, &gt; 9836 ) </code></pre> <p>My code looks like this:</p> <pre><code>ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; [picker setDisplayedProperties:[NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonAddressProperty]]]; [self presentModalViewController:picker animated:YES]; [picker release]; - (void)peoplePickerNavigationControllerDidCancel: (ABPeoplePickerNavigationController *)peoplePicker { [self dismissModalViewControllerAnimated:YES]; } - (BOOL)peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { return YES; } - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier { // Only inspect the value if it's an address. if (property == kABPersonAddressProperty) { ABMutableMultiValueRef multiValue = ABRecordCopyValue(person, property); for(CFIndex i=0;i&lt;ABMultiValueGetCount(multiValue);i++) { CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(multiValue, i) </code></pre> <p>;</p> <p>.....</p> <p>I don't know why it's telling me that an array created this error</p> <p>please help me</p> <p>Edit: Guys, Thanks for the answers, but apparently the problem wasn't even in this code it was a problem from somewhere else really appreciate the help though</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload