You don't need to worry about calling the right class if the selectors and their parameters match -- ObjC has plenty of dynamic dispatch powers.
As far as an implementation, it's pretty common to either:
- create a common base with the interface you want
- or create a protocol which both classes adopt:
MONProtocol.h
@protocol MONManagedShapeProtocol < NSObject >
- (void)prepareFromDictionary:(NSDictionary *)pDictionary;
@end
then (since you know it is one of the two types, MBManagedSquare
or MBManagedCircle
) either derive from the base or adopt the protocol and declare your variable like:
// if subclass
MBManagedShape * castedObject = (MBManagedShape*)object;
or
// if protocol
NSManagedObject<MONManagedShapeProtocol>* castedObject =
(NSManagedObject <MONManagedShapeProtocol>*)object;