问题
Since the update of Xcode 5.0.2, the address book of the simulator is empty. Apparently, if one wants to test address book code on the simulator, one has now to enter the test contacts by hand every time the simulator is reset. Earlier one had the standard test addresses "John Appleseed" etc.
Is there any simpler way to use test contacts on the simulator?
PS: I want to give credit to DipakSonara and Paaske. I had the same problem with my code that worked earlier fine, and I had never thought that the address book has simply be emptied in the update.
EDIT:
I reloaded XCode 5.0.1 from a backup, and the address book has its earlier standard contacts again.
EDIT:
I tried today to open the address book under XCode5.0.2, and simulator 7.0, and the old contacts are there. So this seems to be a intermittent problem.
回答1:
I have also run into this issue. The only solutions I have come up with are:
- Manually add several contacts, which can be frustrating
- Create a project that populates the address book with several contacts, which is easier if you need more contacts
- Now that the iOS Simulator supports iCloud, and you have backed up your contacts, you can sync it to your iCloud account, trigger an iCloud sync, and use your actual address book to test with.
来源:https://stackoverflow.com/questions/20089403/xcode-5-0-2-simulator-address-book-is-empty