Convention with categories is to include a prefix when extending Apple classes. For example:
[string XXDataUsingUTF8];
(Yes, it’s a stupid example. Just go with it.)
What I’m less clear on is what the convention is when the identifier starts with copy, set, init or new.
For instance:
[request setHTTPBodyWithKeyValues: keyValues];
If I add my prefix, this no longer follows the “setters start with set” convention.
[request XXSetHTTPBodyWithKeyValues: keyValues];
On the other hand, if I add the prefix after the set, it’s no longer really a prefix:
[request setXXHTTPBodyWithKeyValues: keyValues];
This isn’t terribly import with set, but I think it becomes more important with init, copy, etc.
Has Apple documented this anywhere? What’s in common use?
You could set the method family explicitly in the interface declaration: