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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:58:41+00:00 2026-05-27T08:58:41+00:00

Ok so this question is two fold. I am creating a bill reminder app

  • 0

Ok so this question is two fold.

I am creating a bill reminder app and want to use CoreData to store all of the data (which I am new to). I have setup all of my entities and relationships (BillAccount one-to-many relationship with Bills). So an account can have many bills.

Question 1: So someone enters the account details and sets how many times the bill will repeat and taps save. How do I create the BillAccount object, then loop through and add all of the Bills for that BillAccount just added? I can easily add one bill and bill account but not sure how to add multiple bills to the one BillAccount.

Question 2: How can I add an additional Bill to an existing BillAccount after I have already created the BillAccount… so editing the bill not adding for the first time? Do have to firstly set the BillAccount object and get its uniqueID. I am a bit confused by this.

Some basic code examples would be great. Thanks for your help.

  • 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-27T08:58:42+00:00Added an answer on May 27, 2026 at 8:58 am

    I am guessing (sorry if i am wrong) that you didn’t generate classes to your core data entities.
    If not –

    1. Get inside you model in Xcode
    2. In the core data editor, select all your entities.
    3. In Xcode menu go to Editor –> create managedObject SubClass
    4. Set the location and save.

    Now go to your project file system and locate the BillAccount entity class. you will find in the .h file that Xcode generated “CoreDataGeneratedAccessors” methods for you:

    - (void)addBillsObject:(Bills *)value;
    - (void)removeBillsObject:(Bills *)value;
    - (void)addBills:(NSSet *)values;
    - (void)removeBills:(NSSet *)values;
    

    Now to your first question

    1. Get all the bills objects you wish to add to the account
    2. Create a NSSet and pass all the bills to it
    3. Add the set to the bill account

        NSSet * billsForAccount = [NSSet setWithArray:allTheBills];
        [billAccount addBills:billsForAccount];
      

    And that’s it for adding many bills to one account.

    As for your second question:

    1. The usual scenario I found is that you present to the user all the accounts, each account is stored in a tableView row (You can use NSFetchResultController for that but It will be impossible to get in to it now).
    2. As for now you can store all of the accounts in an Array when you set the accounts tableView.
    3. When the user selects a row, store the selected account by getting the indexPath.row from the tableView and getting the appropriate account from the Array.
    4. Now use this object to add the bills until the user selects different account.

      Array *allAccounts = [BillAccount allObjects];//will get all of the accounts
      //in the table view methods - use this array to set the tableView rows
      
        //in the userDidSelectRowForIndexPath use
      BillAccount *selectedAccount = [allAccounts objectAtIndex:indexPath.row];
      
      //now use this for adding the bills. (you might want to pass the selected account to other viewController or any other way appropriate to your App structure.
      //when you want to add new bill use
      [selectedAccount addBillsObject:billObject];
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is a bit of a two parter for .Net data services. This
Background This question is in two parts. I have a one-way WCF operation hosted
I came across this question: say given two weights 1 and 3, u can
This question has been discussed in two blog posts ( http://dow.ngra.de/2008/10/27/when-systemcurrenttimemillis-is-too-slow/ , http://dow.ngra.de/2008/10/28/what-do-we-really-know-about-non-blocking-concurrency-in-java/ ),
This question is a bit of a two-parter. First, the title question. Here's what
This question is regarding getopt function in php. I need to pass two parameter
I'm re-asking this question but with a different framework this time. I have two
I have two tables (well, two relevant for this question) : Bets (holds the
Actually, this question seems to have two parts: How to implement pattern matching? How
I'm new to C++, so this question may be basic: I have two classes

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.