I am not sure if I can post this question here because it is about Objective-C.
I start to use Category for my special purpose, but I found many time I used '+' class, for example, I want to parse specific Table from HTML, I made a Category for that as below.
In fact, it doesn't return a Element or array of Element, it returns of array of NSString, I want to know if this is a right way to use Category, or it is better to let it as a standalone function?:
I start to use Category for my special purpose, but I found many time I used '+' class, for example, I want to parse specific Table from HTML, I made a Category for that as below.
Code:
#import "Element.h"
@interface Element (ParseTables)
+ (NSArray *)parseHtml:(NSString *)html forTable:(int)table;
@end
Code:
NSArray *parseHtml(NSString *html, int table);