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 7435629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:06:23+00:00 2026-05-29T10:06:23+00:00

I created a custom LocationGenerator class that uses CoreLocation and Reverse Geocoding, and generates

  • 0

I created a custom LocationGenerator class that uses CoreLocation and Reverse Geocoding, and generates (when asked) a custom Location object. My custom Location object has two instance variables – Address and GPS…both point to instance of two custom classes – Address is a bunch of strings and GPS is three floats – latitude, longitude and altitude.

Location = Address + GPS

For this to work, I needed to create three custom classes – Location, Address and GPS, all with default values set in their respective init methods.

Then I moved to Core Data. In the model I have these entities – Item, Location, Address and GPS. Item entity has some simple string properties and a Location relationship.
The location entity has a Address and GPS relatioship.

Since I moved to Core data, I deleted the custom classes Location Address and GPS I mention above and let Xcode generate classes from based on core data model.

The problem is, I am not sure how to create a Location instance in LocationGenerator anymore.
My former class definitions for Location and Address and GPS are gone, and in those from core data I should not override the init method.but should those generatede classess be a blueprint for my new Location object?

I guess my question is, how should I generate a location object in the LocationGenerator.
Should the LocationGenerator have its Location object created “inside” the managed object context?
To clarify from the UI point of view -I am just in the process of creating an Item, but it is not created yet, it waits for the Location..and only then is it inserted into core data..
Should I look at all objects that are created in the context the same way as i looked at objects before, with the only difference that they are in the context (and managed by the CD rules) and they persist?

  • 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-29T10:06:23+00:00Added an answer on May 29, 2026 at 10:06 am

    The designated initializer for managed objects (Core Data objects, that is) is -initWithEntity:insertIntoManagedObjectContext: which is to say that you can’t create a managed object without it being associated with a managedObjectContext. You indicate that you want to create the object, and then at some time later, decide whether or not to store it. There are essentially two ways to do that. The first way is to have some other object type that’s not an NSManagedObject, but which you can use to populate an NSManagedObject subclass later when you decide to it should be persisted. The other way is to just created the managed object in the context, and then delete it from the context if it turns out that you don’t need it.

    NSManagedObjectContexts can be thought of as “scratch pads.” Nothing is actually persisted until you -save: the context, so if you’re going to be able to make a determination of whether or not to persist the object in the same workflow in which you’re going to save the context, the second way is probably the way to go. If the lifetime of this pre-persisted data is longer than the standard workflow you’re doing with your ManagedObjectContexts then the first way might be better.

    HTH.

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

Sidebar

Related Questions

I created custom wizard that uses hidden divs for wizard pages. Here is the
I've created custom, two level x-axis entries that tend to work pretty well. The
I created a custom button component that accepts an array as a property. I
i created a Custom Trace Liastener inside a class library : namespace SendMailTraceListener {
I have created custom exception class public class Web2PDFException : Exception { public Web2PDFException(string
I created custom adapter like this public class SettingsAdapter extends BaseAdapter{ ArrayList<String> Noptions =
I have created custom result class to serialize json data to xml. I want
I have created custom post types that also have custom meta_boxes I've created. Currently,
I have created custom aplication resource: class Custom_Entitymanager extends Zend_Application_Resource_ResourceAbstract{ //... public function init
I've created custom list: public class BList : IEnumerable<Position> { private List<Position> positions =

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.