Hi,
I am developing an application to backup the whole address book into amazon s3,but i cant able to find any direct iphone api to get the whole address book into any data structure.
I tried the following code,to write the address book array to a file in document directory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *addressPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"AddressBook.plist"];
ABAddressBookRef addressBook = ABAddressBookCreate();
NSMutableArray *allPeople = [[[(NSArray*) ABAddressBookCopyArrayOfAllPeople(addressBook)autorelease]mutableCopy]autorelease];
[allPeople writeToFile:addressPath atomically:YES];
But the problem is file is not getting created in document directory....
Any suggestions appreciated....
Thanks in advance...