Reputation: 478
in some code I saw something like this:
@implementation SomeClass (SomeDelegate)
What does the SomeDelegate
do in that context?
Cheers
Upvotes: 1
Views: 113
Reputation: 22334
It is a category, used to extend the functionality of existing classes. Check out my article on the subject which also contains a collection of really useful categories.
Categories explanation and useful code...find it here.
Upvotes: 1
Reputation: 299545
This is a category. Given that it's call "SomeDelegate", I suspect that someone was just breaking up the code in their implementation file to group all the delegate methods together. Some people use multiple @implementation
blocks to do that. This is the original use of categories. More often today, categories are used to extend existing classes. See the above link for more information.
Upvotes: 3