Attribute called 'description' causes crash
I just started playing with Core Data.
I开发者_如何学JAVA created an entity called Task with a property called Description. I opened Interface Builder and I added Core Data Entity view.
Picked my entity, property and tried to build the application. After clicking on "Add" button it crashed with EXC_BAD_ACCESS.
After I've renamed this attribute to 'desc' it works fine.
Can anyone explain me why is this happening? Is 'description' some kind of reserved word in Core Data or something?
description
is ann Objective-C property used for debugging and goes all the way down to Core Foundation, which has a corresponding CFDescription
function. You should just name that property something else.
It's a method with a particular purpose in Cocoa, and Core Data dislikes it being overridden. More here.
精彩评论