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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:37:29+00:00 2026-05-28T03:37:29+00:00

I am making an app for my school. We are on a 7 day

  • 0

I am making an app for my school. We are on a 7 day rotation schedule…so today is a G day, tomorrow will be an A day, Thursday B, Friday C, and Monday back to D. I want to put a UILabel on the homepage of my app that will output which “day” it is according to our schools A-G notation…can anyone think of a way to do this (that will be understood by a beginner)?

the problem with that is that Monday is not always an “A” day, because we go on a 7 day cycle but only go to school 5 days a week. Any ways around this?

I currently use NSDateFormatter hooked up to a string then to a UILabel to display the current day of the week, if that helps. code for that is below.

 - (void)viewDidAppear:(BOOL)animated
 {

   //get the date today

   NSDateFormatter *dateformatter = [[NSDateFormatter alloc] init];
   [dateformatter setDateFormat:@"cccc, MMMM dd"];

  NSString *dateToday = [dateformatter stringFromDate:[NSDate date]];

   [currentdate setText:dateToday];


   //get the time today

   NSDateFormatter *timeformatter = [[NSDateFormatter alloc] init];
   [timeformatter setDateFormat:@"hh:mm a"];

   NSString *timeToday = [timeformatter stringFromDate:[NSDate date]];
   [currenttime setText:timeToday];

question:

would I use “setText:” to output it to the label? I declared an outlet called *letterday in my .h, and now am trying to send the letter to it, and then this in my .m:

[NSDate JL_currentRotationDayWithSchoolYearBeginningOnDateString:@"2011-09-12"];

[letterday setText: 

does that look right? sorry im so behind on 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-28T03:37:30+00:00Added an answer on May 28, 2026 at 3:37 am

    You can view the source code for the entire category here with comments: https://gist.github.com/1590955

    #import "NSDate+RotationScheduleFormatter.h" in every implementation file in which you would like to use the category. Then use the following method call to get the current rotation day:

    [NSDate JL_currentRotationDayWithSchoolYearBeginningOnDateString:@"2011-08-01"]; where the date is in the format YYYY-MM-DD.

    This will return a enum of type RotationDay, one of kRotationDay[A-G].

    In order for holiday breaks and other weekdays off of school to work you need to go into the .m file and edit the method called + (int)numberOfWeekdayBreakDaysBetweenSchoolYearBeginningDate:(NSDate *)beginningDate andEndDate:(NSDate *)endDate1

    In it you will see an array called weekdayBreakArray with a few values (in the format YYYY-MM-DD). Remove these test values and add in every day of every break that lands on a weekday. Do not add dates that are on weekends.

    Implementation:

    Assuming there exists a UILabel called rotationLetter, you can do the following:

    RotationDay rotationDayInt = [NSDate JL_currentRotationDayWithSchoolYearBeginningOnDateString:@"2011-08-01"];
    if (rotationDayInt == kRotationDayA) {
        [rotationLetter setText:@"A"];
    }
    else if (rotationDayInt == kRotationDayB) {
        [rotationLetter setText:@"B"];
    }
    

    and so on with more else if statements until you reach kRotationDayG.

    Notes:

    Remember to enclose your call to this method in an if statement that checks if you’re on a holiday break or on the weekend since the result will be incorrect otherwise. Also note that I did not optimize this class for memory management using manual retain/release because I wasn’t sure if you’re using ARC. Furthermore, the entire system fails if you have a snow day or some other unexpected break and you cannot update the app in time. Therefore I highly advise that you download the array of dates from a server every time you open the app in case you need to make a change on the fly.

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

Sidebar

Related Questions

i'm making app that the main page include TableView but i want when i
i m making APP which do image proceesing using java SE.i want to check
I'm making this app with a tableview and stuff. I want to make a
I am making an app for school and I would love to change the
I am making a iphone app for my local school. I have a good
I'm making App in Netbeans platform in Java Swing. I want to add and
I am making App. that includes Picture Editing, After Editing I want to save
Making an app where we want to send a photo to a server along
I making an app in Java. I want an Open With Dialog to appear
I'm making an app for my school which people can check with if they've

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.