I’m using a declaration of function that converts NSData into hexadecimal NSString
@implementation NSString (Hex)
+ (NSString*) hexStringWithData: (unsigned char*) data ofLength: (NSUInteger) len
{
NSMutableString *tmp = [NSMutableString string];
for (NSUInteger i=0; i<len; i++)
[tmp appendFormat:@"%02x", data[i]];
return [NSString stringWithString:tmp];
}
@end
- What is name of this procedure?
(I mean how is called this@implementationinto/of class which I haven’t defined and where is documentation ?) - What purpose has
(Hex)part of implementation ?
Thanks
That is a class cateogry that provides a way to add extra methods to existing classes without the need of subclassing.
Hexis the name of this particular category because a single class can have multiple categories. Special consideration should be taken when creating categories because it is possible to override existing or future methods.