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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:52:59+00:00 2026-05-19T15:52:59+00:00

After the long time I spent getting an analog clock to work, I am

  • 0

After the long time I spent getting an analog clock to work, I am trying to make a digital one (sigh). I am trying to do this with 10 PNGs with the numbers 0 – 9. Each digit of the clock would be an image. The only problem with this is retrieving the certain digit from the current time. I’ve tried converting the time to a string and using the characterAtIndex, but that doesn’t seem to work. What would be the best way to get around 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-05-19T15:53:00+00:00Added an answer on May 19, 2026 at 3:53 pm

    You could use NSDateComponents and NSCalendar:

    NSDate * date = [NSDate date];
    NSCalendar * calendar = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents * components =
                        [calendar components:(NSHourCalendarUnit | NSMinuteCalendarUnit) fromDate:date];
    
    NSInteger hour = [weekdayComponents hour];
    NSInteger minute = [weekdayComponents minute];
    NSInteger firstHourDigit = hour/10;
    NSInteger secondHourDigit = hour%10;
    NSInteger firstMinuteDigit = minute/10;
    NSInteger secondMinuteDigit = minute%10;
    
    • 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 dupe) I've just spent a long time trying to
I've spent a long time trying to figure out this issue, I need a
I am very confused and have spent a long time trying to debug this
After a long time searching and trying I'm asking now for help: My situation:
I just spent a long time breaking my teeth on why this code was
I feel like an idiot because I've spent a long time trying to find
After searching a long time for a performance bug, I read about denormal floating
I've been using Symfony for a long time but I'm new to Symfony2. After
I'm getting back in to Cocoa development on the Mac after a long stint
I spent a long time learning how to customise WCF from the point 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.