iphone - if NSDate is Monday -


How can I check whether the NSDT is a specific day of the week, such as Monday, Tuesday, Wednesday and so on?

From memory (I do not currently have the work of the Objese environment):

  int yourDOW = [[[NSCalendar current calendar] component: NSWeekdayCalendarUnitDate from: yourDate] day of the week;]; In other words:  
  • Get the user current (if your (your dow == 2) {...} // sun = 1, sat = 7

calendar.

  • Get a week-day unit based on the given date.
  • Get that day from that day.
  • Compare with what you want.

  • Comments

    Popular posts from this blog

    windows - Heroku throws SQLITE3 Read only exception -

    lex - Building a lexical Analyzer in Java -

    python - rename keys in a dictionary -