Skip to content

Instantly share code, notes, and snippets.

@jyliang
Created November 16, 2016 15:11
Show Gist options
  • Save jyliang/338eba135bc7b7ec60e30ca685a8e22a to your computer and use it in GitHub Desktop.
Save jyliang/338eba135bc7b7ec60e30ca685a8e22a to your computer and use it in GitHub Desktop.
Hacking Objective C
https://docs.google.com/presentation/d/19AiyALt7-t5MZLBgTubaJ66njM2GLTO54oOiMG1KAog/edit#slide=id.g13a6caa795_0_7
#define BMTDollarReader(fieldName) \
- (double)fieldName ## Value { \
return BMTCentsToDollars(self.fieldName ## CentsValue); \
} \
\
- (NSNumber *)fieldName { \
return self.fieldName ## Cents ? @(self.fieldName ## Value) : nil; \
} \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment