I am working on an active record project. I am specifically writing the .find method, where you pass a query. So you will say:
Person.find(“lastname=10”)
Here a query will be run that will get a list of objects of type person who’s query match the find parameter.
All is good, but I want to write this in a super class that can become anything (a model). So my base class is called KLActiveModel and it has a method that can parse the recordset cursor to the properties, however in this case I am trying to create an array of subclasses from a super class… (An array of Person objects in the KLActiveModel) however the superclass has no way of knowing the type of class the subclass is.
What i want is instead of returning from the subclass a KLActiveModel() array i want to return a ‘WhateverTheSubclassTypeIs()’
I hope I am explaining myself, basically I want to return an array of objects of the kind the instance is… Kind of returning an (id) array in objective-c, but in OC casting will work… Not in Xojo.
Any clues welcomed!