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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:08:47+00:00 2026-06-09T14:08:47+00:00

I’m trying to figure the best approach to solve this problem. — I have

  • 0

I’m trying to figure the best approach to solve this problem.

—

I have a “History” table that,
lists ALL years that have data.

If a user clicks a given Year, it segues to a new Table and,
lists ALL months that have data.

Clicking a given month, shows a new table that,
lists ALL days that have data.

Clicking a specific day, shows a list of one or multiple Time Stamps.

—

What is the best approach to solve this?

If user creates a Time Stamp. I need to insert it with today’s date.

I also need to have the ability that if a user,
Deletes a given year. Everything in that year is deleted.

That same way,
Deleting a month, deletes everything in that month, for it’s particular year.

And so on, to the point where the user should be able to delete Individual Time Stamps.

—

I thought I would Use a Dictionary with key for the “year”. 2012, 2013, …

And each retrieving another Dictionary with key for the “month”, 1, 2, 3, 4, …

And so on … and so on …

I also thought I could make a model using Core Data.

A Class Year representing the “Year” entity, having a relation to many possible Months, and each month, having a relation to many possible days, and days to Time *Stamps*.

And last,

I thought of creating a model with only two Entities.

Entries, with only one attribute “Date“, that has a to-many relationship to “Time Stamps“, receiving All the possible Time Stamps for that given day.

I am new to iOS programming. So this is all theory for me. But I did follow some Core Data tutorials and others working with NSDictionaries, protocols delegates and so on.

The “Dig In” approach as I go trough, seems more elegant. Specially because I think I could delete a particular given object in a cascade manner?

Do any of these make sense? Or is there a more obvious easy way to go about it? Also, please consider in the answer what would be easier to implement if a user chooses to delete a given entry in the “tree”

Any help is most appreciated.

Thank you advance!

Nuno

  • 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-09T14:08:48+00:00Added an answer on June 9, 2026 at 2:08 pm

    If you are going to rely on Core Data or any database engine, the best way to solve this is to use the database itself.

    I see two possible solutions (there is more of course). The first, the simplest :

    Entity
    - timestamp
    - year
    - month
    - day
    - all_the_stuff_you_need
    

    Make year, month and day readonly, updated along timestamp. Indexes: year, year+month, year+month+day. Easy call.

    That way, you can very simple query the database, asking it to return the entities you need and only the entities you need.

    A more complex setup would be:

    Entity
    - timestamp
    - all_the_stuff_you_need
    - year -> Year
    - month -> Month
    - day -> Day
    
    Year
    - year
    - entities ->> Entity
    
    Month
    - month
    - entities ->> Entity
    
    Day
    - day
    - entities ->> Entity
    

    So basically, 3 data domains for the years, months and days, months and days being immutable.

    That structure is more complex, but it gives a better view of your data. You have a direct access to more information on your data as the data domains are explicit and well defined.

    A third solution would be to create a date entity with year, month and day, with one entry per day. A middle ground between the two solutions above. Less interesting I think, but hey, it may suit your needs anyway.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put

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.