简体   繁体   中英

<value temporarily unavailable, due to optimizations> CFArrayGetValueAtIndex

CFArrayGetValueAtIndex im not able to retrieve the value from address book when i tried accessing i get error

ABAddressBookRef addressBook= ABAddressBookCreate(); // this will open the AddressBook of               the iPhone
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook); // this copies all the contacts from the Address Book into the array

for (int i =0 ;i<ABAddressBookGetPersonCount(addressBook);i++)
{
  ABRecordRef ref = CFArrayGetValueAtIndex(people, i);
  NSString *AddBookfirstName = (NSString *)ABRecordCopyValue(ref,kABPerson);
}

this i variable returns statement telling ??? what is the problem here im not able to get the address book value

I met this problem and here is what I did to solve the problem: Since Xcode mentions the "optimization", I select the Project in Project Navigator, click Build Settings, find "Optimization Level", change it to "None[-O0]", and then it works.

After doing this, when you are debugging, Xcode's reaction will slow down, but you could check the variable value that couldn't do before. And the code will be executed sequentially, no jumping any more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM