[swift-users] CoreData weirdness in development build

Charles Lane clane_47 at bellsouth.net
Tue Jun 7 14:29:38 CDT 2016


Here’s something ‘cute’. Make a simple ios project using coredata. Name an entity whatever you like, but give it any attribute that starts with ‘is’. Such as isVisited or isDone or whatever you like of type Boolean.  Try setting the entity to true or false, no matter, and save the entity. The project will fail saying : 2016-06-07 15:10:55.601 TestCoreData[5269:1527094] -[TestCoreData.HoldBoolean setDone:]: unrecognized selector sent to instance 0x7fd9fbc59380. (HoldBoolean was the entity name in the project)
The attribute in that case was set to ‘isDone’, if the attribute had been named ‘isWhatever’, it would have failed saying TestCoreData.HoldBoolean setWhatever:] 
CoreData won’t accept any attribute starting with ‘is’. This is with the latest June 6 development build but it was the same in the May 31 build. This may only affect attributes of type boolean, I haven’t checked that.

Or am I doing something stupid?



More information about the swift-users mailing list