Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attribute called 'description' causes crash

I just started playing with Core Data.

I 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?

like image 807
Vojto Avatar asked Jul 07 '10 17:07

Vojto


2 Answers

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.

like image 128
lucius Avatar answered Nov 18 '22 14:11

lucius


It's a method with a particular purpose in Cocoa, and Core Data dislikes it being overridden. More here.

like image 6
warrenm Avatar answered Nov 18 '22 14:11

warrenm