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

  • SEARCH
  • Home
  • 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 6353351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:23:44+00:00 2026-05-24T22:23:44+00:00

I want to get friends information from Facebook and save it with Core Data.

  • 0

I want to get friends information from Facebook and save it with Core Data.

I build a FriendsManager Class that gets the a list of friends from Facebook (name and id)
and a FriendInfo Class that takes the id and gets all the info about this friend.

I thought I’d do it this way:

  • Create an object of FriendsManager let it get all my friends (not really a problem);
  • in the FriendsManager create an instance of FriendInfo;
  • give it the id and let it get all the info I need including geocoding of hometown;
  • save all this with core data.

But then where do I release this object?

In Order to get all the friends info I would create these objects in an loop that goes through my Array with friend ID’s.

I also do all the getting info & geocoding with Grand Central Dispatch so do not really know when a FriendInfo got all the data it needs and is ready.

  • 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-24T22:23:46+00:00Added an answer on May 24, 2026 at 10:23 pm

    A Core Data object is usually a subclass of NSManagedObject, not a NSObject. You don’t alloc or release it, you create one with the ManagedObjectContext and you either save or delete it but you don’t release it because you don’t own it.

    A NSObject (prior to ARC) follows the usual rules of memory management – simply, if you get it through alloc, copy or a method starting with new, it is yours and you need to use release when you no longer use it. If you get it without allocating it – for example "NSString *string = [NSSTring stringWithFormat:@"test"]; then it is autoreleased and you don’t need to release it.

    Trust the analyser – shift-command-B.

    Sounds like you might want to define your core data model and then create a NSManagedObject subclass for the friends information. You would create it using something like [NSEntityDescription insertNewObjectForEntityForName:@"FriendInfo" inManagedObjectContext:moc]; rather than [[FriendInfo alloc] init] as you would if it were a NSObject. The shift in thinking is that the object is created and managed by the ManagedObjectContext before you put any data in there, you request a new one and put in the data, then inform the ManagedObjectContext what you want done with that object – save or rollback (reverse all changes since the last save).

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

Sidebar

Related Questions

I get back a json object from Facebook which contains some friends information. Some
I want to create a friends system like facebook, well quite weird than that.
I want get all of the Geom objects that are related to a certain
I want to get an overview of files that are updated in TFS (that
I want to get a list of files in a directory, but I want
I have got the user's information from contacts,and I want to store the information,so
I am developing a Facebook Application and I want to present information to users
I want to get photos information of a friend's public album. If I use:
How can i get my current UID with FQL.. i want to save traffic
I want get the time used for a case so I can create an

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.