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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:29:16+00:00 2026-06-10T20:29:16+00:00

in iOS5.0, using arc, i’m using Magical record to create objects in core data.

  • 0

in iOS5.0, using arc, i’m using Magical record to create objects in core data. I have a product object that has a one to many relationship called ‘currentPromotions’ with Promotion objects. Promotion object has an inverse relationship ‘parentProduct’, too. I am able to create these objects, but am stymied at how to create the relationship and attach the Promotion objects to the product using MagicalRecord in github.

Also the documentation on magical record is too sparse. any pointers on this will also be helpful.

Thanks in advance for your help on this

  • 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-06-10T20:29:17+00:00Added an answer on June 10, 2026 at 8:29 pm

    Most information on Core Data applies when using MagicalRecord. I suggest looking there first when looking for documentation. MagicalRecord basically tries to codify what the docs tell you is a good idea.

    For your problem though, it seems that you have a relationship like this:

    Product <---> Promotion
    

    You connect your two instances like this:

    Product *a = //...;
    a.promotion = [Promotion createEntity];
    

    Everything else is done for you, not by MagicalRecord, but Core Data.
    If you want to add a product to your collection of products for a promotion, you can do:

    Promotion *p = //...;
    [p addProductOjbect:[Product createEntity]];
    

    The addProductObject: method is created for you at runtime by Core Data.

    I highly suggest that you learn more about Core Data when looking into MagicalRecord, since MagicalRecord does not really hide anything. It just makes the “easy” stuff simple, and the hard stuff possible.

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

Sidebar

Related Questions

for an iOS 5.0 application using ARC, i have an NSArray of objects that
I have a UITableview cell that gets a tally from a core data database.
This project is for iPhone with iOS 5 using ARC and Core Data. All
I'm writing an app (in iOS 5 using ARC!) that presents several hundred objects
I'm writing an iOS 5 app (in Xcode 4.3, using Storyboards and ARC) that
Using: iOS 5, ARC, StoryBoards. Have 1 image and text on every cell. Images
I'm developing an iOS5 App using ARC, and I started to get some random
I am new to iOS5 development and using objective-c. I have trouble understanding the
I have the following error on a Ios 5 application using ARC: *** -[ViewDettaglio
I'm using Blocks in iOS5 with ARC to play a never ending cycle of

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.