marcoarment / FCModel

An alternative to Core Data for people who like having direct SQL access.
MIT License
1.65k stars 173 forks source link

id property is recognized as primitive type #46

Closed ahti closed 10 years ago

ahti commented 10 years ago

I have a model class that has a property named value, of type id.

Depending on some external information, my implementations of -serializedDatabaseRepresentation... and -unserializedDatabaseRepresentation... will convert the database value into one of some possible types (NSDate, NSString, NSNumber, ...).

For this property, FCModel warns me about allowing NULL and says the property is a primitive type, while it very much isn't.

I don't know if this has any further implications or if it is just the warning.

(fwiw, the database colum is declared without any type)

marcoarment commented 10 years ago

The other implication is that FCModel won't let you save NULL to that column, since it thinks it's a primitive and there's no concept of, say, a NULL int.

I think this is a bug that I should fix, but let me look into it. Besides the default serialization not working (which you've alleviated by custom serializers), what other weirdnesses may result from allowing id properties?

marcoarment commented 10 years ago

I got impatient and just fixed it.