AnyClass protocol and Objective-C methods
[]
Augmented Code
While working on code using CoreData, I needed a way to enumerate all the CoreData entities and call a static function on them. It is easy to get the list of entity names of the model and then turn them into AnyClass instances using the NSClassFromString() function. At this point I had an array of AnyClass instances where some of them implemented the resetState function, some didn’t.