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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:33:00+00:00 2026-05-23T18:33:00+00:00

I need to create a loop that detects when 24 hours passes, the number

  • 0

I need to create a loop that detects when 24 hours passes, the number changes on my calendar from 1 to 2 then 2 to 3 … all the way to 31. So when it is the 31 it says 31. However the number is on my tab-bar symbol and I have drawn the number on using quartz and so the number is not an integer but an nsstring with the number written. the number that is displayed is 6 when it should be today’s date 17. Not sure where i am going wrong?

Here is my code so far:

- (void)updateLabelForDate:(NSDate *)date {
NSTimeInterval timeInterval = [date timeIntervalSinceReferenceDate];
NSInteger days = timeInterval / (60*60*24);
NSArray *sloganArray = [NSArray arrayWithObjects:
                        NSLocalizedString(@"1", nil),
                        NSLocalizedString(@"2", nil),
                        NSLocalizedString(@"3", nil),
                        NSLocalizedString(@"4", nil),
                        NSLocalizedString(@"5", nil),
                        NSLocalizedString(@"6", nil),
                        NSLocalizedString(@"7", nil),
                        NSLocalizedString(@"8", nil),
                        NSLocalizedString(@"9", nil),
                        NSLocalizedString(@"10", nil),
                        NSLocalizedString(@"11", nil),
                        NSLocalizedString(@"12", nil),
                        NSLocalizedString(@"13", nil),
                        NSLocalizedString(@"14", nil),
                        NSLocalizedString(@"15", nil),
                        NSLocalizedString(@"16", nil),
                        NSLocalizedString(@"17", nil),
                        NSLocalizedString(@"18", nil),
                        NSLocalizedString(@"19", nil),
                        NSLocalizedString(@"20", nil),
                        NSLocalizedString(@"21", nil),
                        NSLocalizedString(@"22", nil),
                        NSLocalizedString(@"23", nil),
                        NSLocalizedString(@"24", nil),
                        NSLocalizedString(@"25", nil),
                        NSLocalizedString(@"26", nil),
                        NSLocalizedString(@"27", nil),
                        NSLocalizedString(@"28", nil),
                        NSLocalizedString(@"29", nil),
                        NSLocalizedString(@"30", nil),
                        NSLocalizedString(@"31", nil),
                        nil];
NSInteger usedSloganIndex = (int)days % [sloganArray count];
slogan = [sloganArray objectAtIndex:usedSloganIndex];
NSLog(@"Slogan: %@", slogan);
NSLog(@"%i",usedSloganIndex);

int x,y,width,height;


x = 23;
y = 440;
width = 20;
height = 20;



CustomBadge *customBadge1 = [CustomBadge customBadgeWithString:slogan];


- (void)applicationSignificantTimeChange:(UIApplication *)application {
[self updateLabelForDate:[NSDate date]];
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
[self updateLabelForDate:[NSDate date]];
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

// Override point for customization after application launch.

// Add the tab bar controller's view to the window and display.
[window addSubview:tabBarController.view];
[self addTabBarArrow];
[window makeKeyAndVisible];

[self updateLabelForDate:[NSDate date]];

return YES;

}

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-05-23T18:33:00+00:00Added an answer on May 23, 2026 at 6:33 pm

    You can be notified when the date changes by implementing applicationSignificantTimeChange: in your application delegate. Check its documentation for when it will be called, but it includes the times you almost certainly want.

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

Sidebar

Related Questions

I'm writing a script and I need to create a loop that will execute
I need to create a function that uses a loop. This function will open
I need some help. I want to create a for loop that creates n
I'm trying to create a simple loop that adds a random number of stars,
I need to create a PostgreSQL function that will use the values from two
In Java (Android), is there a way to create a loop that goes through
I need to create a historical timeline starting from 1600's to the present day.
I need to create an XML schema that looks something like this: <xs:element name=wrapperElement>
I need to create a backup of a SQL Server 2005 Database that's only
I need to create a variable that contains time in the format hh:mm, how

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.