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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:40:46+00:00 2026-05-21T06:40:46+00:00

I am creating a Travel Guide iPhone app. I created a city Entity in

  • 0

I am creating a Travel Guide iPhone app. I created a city Entity in Core Data. It has name, image, and description attributes. Now I want to show restaurants and famous places according to selected cities in another view. Each city may have a number of restaurants and famous places. So I decided to create one other Entity, place. I am confused about the relationship between city and place. I want to make the city id as foreign key in place…what should I do?

  • 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-21T06:40:46+00:00Added an answer on May 21, 2026 at 6:40 am

    Core Data is not a relational database. Forget about foreign keys etc. You need to simply set a to-many relationship from the entity City to the entity Place. Also, you need to set the inverse relationship. At runtime, you will be updating one side only of the relationship: Core Data will automatically update the other one for you. This is just one of the benefits of using Core Data. But you need to start reading the documentation, in order to fully understand the difference w.r.t. a relational database. Core Data is an object graph management tool. It works with underlying XML, in memory and SQLite stores. The fact that your data may be backed-up by SQLite should not confuse you.

    One more thing. You can not have an attribute called “description” in your entities. You can not have any attribute whose name is the same as one of the attributes of NSObject. This collision will not work.

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

Sidebar

Related Questions

I am creating Travel guide app using core data. I have 4 entities CITY
I am using Map kit framework. I am creating travel guide app for iphone.
I am creating a travel theme in which I have created some custom posts
Using Rails 3.1.1 I am creating a travel guide that typically consist of articles.
Creating an a app, where I store bunch of photos in the drawable folder,
Error creating bean with name 'sessionFactory' defined in class path resource [ApplicationContext.xml]: Invocation of
Possible Duplicate: Generating Random Numbers in Objective-C Hi I am creating an app where
Creating a Blackberry app. Just a beginner, I have searched but couldn't find a
Creating a searchable contacts kind of app. Below is my code public class EmployeeList
I am creating a map application in Objective-C, for iPhone. I know how to

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.