Design Element
Comment on "New Objective-C Tutorial"
by Steven Degutis — Apr 14
In the tutorial, at the end, you give an example of a category which implements the -isURL method on NSString. Assuming the goal is to explain categories, and not a good method, you could probably replace the entire contents of that with this, in order to get the point of a category across less confusingly, and it would be functionally the same as your current method:
- (BOOL) isURL { if ( [self hasPrefix: @"http://"] ) return YES; // else return NO; }
Back to "New Objective-C Tutorial"
Design Element

Copyright © Scott Stevenson 2004-2015