Why can't I use “description” as an attribute name for a Core Data entity?

前端 未结 3 1792
深忆病人
深忆病人 2020-12-15 19:02

I have a simple Core Data entity that had a string attribute named \"description\". The program crashes when it hits:

valueForKey:@\"description\"

3条回答
  •  忘掉有多难
    2020-12-15 19:12

    description isn't a reserved keyword in CoreData, but it's a property on all Objective-C objects inherently. It's part of the NSObject class.

    http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html#//apple_ref/occ/intfm/NSObject/description

提交回复
热议问题