I have a series of \"policy\" objects which I thought would be convenient to implement as class methods on a set of policy classes. I have specified a protocol for this, and
This
id counter = [[Model availableCounters] objectAtIndex:0];
return ( [counter countFor: nil] );
Should be
Class counter = [[Model availableCounters] objectAtIndex:0];
return ( [counter countFor: nil] );
In the first you have an instance that conforms to
. In the second you have a class that conforms to
. The compiler warning is correct because instances that conform to
don't respond to countFor:
, only classes do.