Skip to content

Instantly share code, notes, and snippets.

@GE-N
Created July 26, 2015 08:17
Show Gist options
  • Save GE-N/1657bfd42a8e9cd3681f to your computer and use it in GitHub Desktop.
Save GE-N/1657bfd42a8e9cd3681f to your computer and use it in GitHub Desktop.
// (1)
// Get report by month
// without Enum
-(Report *)reportFor:(int)month {
...
}
Report *reportMay = self.reportFor(5) // Report for May
// ======================================================== //
// (2)
// Get report by month
// with Enum
typedef enum Month {
January = 0,
February,
March,
April,
May,
June,
July,
August,
October,
November,
December
}
(Report *)reportFor:(Month)month {
...
}
Report *reportMay = self.reportFor(May) // Report for May
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment