I'm trying to get just the first 100 of contacts from the Address Book. What I've done is getting all the contacts and then tried to get only the first 100. For some reason that doesn't work (code below).
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef allContacts = ABAddressBookCopyArrayOfAllPeople(addressBook);
NSRange theRange;
theRange.location = 0;
theRange.length = 100;
CFArrayRef allContactsNew = (CFArrayRef)[(NSMutableArray *)allContacts subarrayWithRange:theRange];//This gets an error
Would appreciate help here. Also, If you know any other method to get only the first 100 or so directly from the Address Book that could be very helpful.