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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:15:23+00:00 2026-06-13T12:15:23+00:00

I have an expense tracking iOS Application using Core Data Model: Scenario: -> An

  • 0

I have an expense tracking iOS Application using Core Data Model:

Scenario:

-> An abstract parent entity named “Money” with attributes “vendor”, “date”, “amount” and so on. The two sub-entities “Expense” and “Income” inherit from the parent entity “Money”. Then there are other entities such as “Category” and “subCategory” with their attributes. Total as of now: 5 entities (Money, Expense, Income, Category and Subcategory) in my data model.

Question: What I want to achieve is to track expenses daily, per week, bi-weekly, monthly and yearly. I am thinking to make an entity say “Months” with 12 attributes ( Jan – Dec – > month names) but isn’t that too much complicated?

Thoughts?

I have a Table-view and using NSFetchedResultsController to fill my table-view with the mix od expenses and Incomes.

  • 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-13T12:15:24+00:00Added an answer on June 13, 2026 at 12:15 pm

    You have to create an NSFetchRequest with an NSPredicate that filters for the appropriate time period. Let’s say you want to list all expenses between two dates your could implement a method that returns an NSFetchRequest that filters for this period:

    - (NSFetchRequest *)filteredFetchRequestForEntity:(NSString *)entityName startDate:(NSDate *)startDate endDate:(NSDate *)endDate
    {
        NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(date >= %@) AND (date <= %@", startDate, endDate];
        NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
        NSEntityDescription *entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:self.managedObjectContext];
        [fetchRequest setEntity:entity];
        [fetchRequest setPredicate:predicate];
    
        return fetchRequest;
    }
    

    You could then use this fetchRequest for example in an NSFetchedResultsController
    similar to my answer in your other question:
    CoreData and TableViews

    Then all you’d have to do is create the NSDate objects for start- and endDate for your desired time period and pass them to this method.

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

Sidebar

Related Questions

Scenario : I have an expense tracking iOS Application and I am storing expenses
Describing Core Data Model: I have a Core data model for my Expense tracking
In my application I add income and expense data and display it in a
i have three tables file, expense and payment. I want fetch data from 3
I have a .txt file containing data like this: 1,Rent1,Expense,16/02/2010,1,4000,4000 1,Car Loan1,Expense,16/02/2010,2,4500,9000 1,Flat Loan1,Expense,16/02/2010,2,4000,8000
I have a .txt file containing data like this: 0,Rent1,Expense,16/02/2010,1,4000,4000 0,Car Loan1,Expense,16/02/2010,2,4500,9000 0,Flat Loan1,Expense,16/02/2010,2,4000,8000
I'm writing an expense tracking program. At the moment I have three class Lineitem
I have four tables in my database( notes , expense , category and items
I have the this function: @Override public List<Expense> getExpensesBetween(Date firstDate, Date secondDate) { Query
I have 2 tables Table1 with columns [BId,Name,Amount] Table2 with columns [CId,BId, ExpenseType,Expense]. BId

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.