How to create a strategy pattern in Objective-C?
I need to develop a strategy pattern where i have a main class with other three classes where i need to refer to the objects of the other three classes using the main class object.To solve this is the strategy pattern will help me? If so please do give me the syntax in Objective-C? You'll want to look at Objective-C's protocol mechanism. Here's a simple protocol with a single required method: @protocol Strategy <NSObject> @required - (void) execute; @end Then you declare a class that fulfills that protocol: @interface ConcreteStrategyA : NSObject <Strategy> { // ivars for A } @end The