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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:37:40+00:00 2026-06-12T18:37:40+00:00

I have a dictionary in this basic setup: ->Root —>Monday ——->Date 1 ——->Date 2

  • 0

I have a dictionary in this basic setup:

->Root
--->Monday
------->Date 1
------->Date 2
--->Tuesday
------->Date 1
------->Date 2
--->Wednesday
------->Date 1
------->Date 2
--->Thursday
------->Date 1
------->Date 2
--->Friday
------->Date 1
------->Date 2

How can I find, from this dictionary, the earliest date from all of these values?

Assuming that the date is changing the current value is ( [NSDate date]) what would I need to do to find loop through each day, the current day being the first to loop through, and find the closest date to the current date.

I hope I have made this clear. Thanks

  • 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-12T18:37:41+00:00Added an answer on June 12, 2026 at 6:37 pm

    Do you have a root dictionary, with Day-of-the-week keys. Each day of the week points to an object which is a dictionary of ‘Date 1’ and ‘Date 2’ (what I’m saying does not have to be exactly what you have, this works for any structures). I’m going to use ‘fast enumeration’ but block enumeration can be used too.

    Start off by creating a NSDate object and set it to ‘now’.

    NSDate *date = [NSDate date];
    
    for(NSString *key1 in root) {
      NSDictionary *dates = [root objectForKey:key1];
      for(NSString *key2 in dates) {
        NSDate *otherDate = [dates objectForKey:key2];
    
        date = [date earlierDate:otherDate];
      }
    }
    

    at the end date will be the earliest date.

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

Sidebar

Related Questions

Sorry if this is a basic question, I can't find a definitive answer. I
Although this is pretty basic, I can't find a similar question, so please link
i have this dictionary: a) 2012 UN NEWNW = ( 2012/06/04 Saudi Arabia Huge
I have this dictionary in my apps model file: TYPE_DICT = ( (1, Shopping
I have a dictionary like this: /// <summary> /// Gets the leave entitlement details.
I want to have a dictionary of functions. With this dictionary, I could have
I have a python dictionary of type defaultdict(list) This dictionary is something like this:
I have a Dictionary called AvailableBoxes. I want to lookup a string in this
I have a dictionary, user_dict, and create a list for each user value, this
I have a dictionary: a = {'100':12,'6':5,'88':3,'test':34, '67':7,'1':64 } I want to sort this

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.