Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6777055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:06:09+00:00 2026-05-26T16:06:09+00:00

I am using google contact data objective c APIs for fetching contacts. I got

  • 0

I am using google contact data objective c APIs for fetching contacts. I got contacts array from google server now i want to write contact to file. i am using writeToFile:atomically: method for writing array to file but This method is not working for me since i feel that output array from gdata API not contain property list objects. Please suggest any alternate solution.

-(void)fetchData{
    GDataServiceGoogleContact *service=[[GDataServiceGoogleContact alloc] init];
    [service setShouldCacheResponseData:YES];
    [service setServiceShouldFollowNextLinks:YES];
   [service setUserCredentialsWithUsername:[mUsername stringValue] password:[mPassword stringValue]];

    // GENERATING THE URL
    NSURL *feedURL=[GDataServiceGoogleContact contactFeedURLForUserID:kGDataServiceDefaultUser];
    GDataQuery *contQuery=[GDataQueryContact contactQueryWithFeedURL:feedURL];
    [contQuery setShouldShowDeleted:YES];
    [contQuery setMaxResults:2000];
    GDataServiceTicket *ticket=[service fetchFeedWithQuery:contQuery delegate:self didFinishSelector:@selector(hasFetchedContacts:feed:error:)];    
}


-(void) hasFetchedContacts:(GDataServiceTicket*) ticket  feed:(GDataFeedContact*) contacts error:(NSError*) err
{
    NSArray *contactList=[contacts entries];
    NSLog(@"%d",[list writeToFile:@"/Users/subhranil/Desktop/contactList" atomically:NO]);  

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:06:09+00:00Added an answer on May 26, 2026 at 4:06 pm

    You can use byte array for this purpose and NSData for writing to file.
    For saving:

    NSData *data=[[NSData alloc] initWithBytes:[contacts entries] length:total];
    [data writeToFile:@"path" atomically:YES];
    

    total= The total size of the array in bytes

    For retrieving:

       NSData *newdata = [NSData dataWithContentsOfFile:@"path"];
       NSUInteger len = [newdata length];
       Byte *byteData = (Byte*)malloc(len);
       memcpy(byteData, [newdata bytes], len);
    

    byteData will now contain an array of GDataEntryContact objects and you can use them accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get xml data from google server using it's API. so, i
I'm using code from this page http://code.google.com/apis/contacts/docs/1.0/developers_guide_js.html to get list of gmail contacts. Actually
I want to create Contact on Google Apps. I am Using this API And
So, I am using Google Contacts API to let users import their contacts from
I'm currently using this function to get all my contacts from Google Contacts. session_start();
With the Google Contacts API, you can GET contact information using JSON, but is
I am using two legged OAuth for Google Contact Data API and generating token
I'll synchronize the data from Google Contacts with a datastore in App Engine... i'm
This is with reference to using Google Contacts Data API. It requires that the
When I deal with deleting a contact using new google api, I got the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.