It has to be specified while creating the core data model in IB what Kind of attribute it will be, theres choices like String, Date, Integer, Decimal etc.
My question is, how do i store lets say an NSDate in the same attribute, and at some other time, add a new entity but this time with an NSNumber for that attribute.
In other words, i’d just want an equalent of id Object in coredata, where after fetching, i’d check if [[Object isKindOfClass[NSDate class]] or an NSNumber.
I’ve heard of transformable, but i’m not creating customized Objects to be stored.
Any light on this would be great
This is a very bad idea. Actually, dates are represented as numbers in SQLite, but Core Data could be using a different kind of store, so you are just making too many assumption of how things are going to work.
It would be much cleaner and easier to specify additional attributes for your entity, a
numberand adate. You could then easily check if any of them isnilor contains a value. Even introducing a third attribute to tell you if the object has a date or number would be preferable to your setup.