marcoarment/FCModel — pull request #55 by apalancat (2014-04-14 09:28:57+00:00)
Title: Don't crash when using custom tableName

When a model uses a custom `tableName` its info doesn't get added to `g_fieldInfo` and `g_primaryKeyFieldName` when opening the database, this causes a crash when using the model later.
Here I'm using `objc_getClassList` to find all the subclasses of FCModel and ask for the `tableName` if `NSClassFromString(tableName)` returns nil, maybe it's too hacky?
If you'd prefer a cleaner solution then a `registerClass:` approach would be it I guess, but then you'd be requiring subclasses to register. Matt Gallagher has [this post](http://www.cocoawithlove.com/2010/01/getting-subclasses-of-objective-c-class.html) from where I took the `ClassGetSubclasses()` code and he outlines it.