Just enter damian86 into the Objective-C style (a reference to self suggests the context of the object, change it accordingly, you can make it a category, etc.):
-(int)greatestCommonDivisorM:(int)m N:(int)n { int t, r; if (m < n) { t = m; m = n; n = t; } r = m % n; if (r == 0) { return n; } else { return [self greatestCommonDivisorM:n N:r]; } }
Toddb
source share