Overriding isEquals in Objective-C
I am currently working on a small personal project, an iPhone app written in Objective-C. I needed a simple data structure to hold a 2-element tuple of integers. I originally implemented this as a C-struct:
1 2 3 4 5 |
|
This worked fine, but I often found myself doing a multiline declare-then-set-members pattern every time I wanted to use the data structure. To simplify, I added a small C function to generate structs, similar to CGRectMake
: