Why I get warnings using “imageTitle” as an attribute name for a CoreData entity?
I get warnings in Xode 4 using “imageTitle” as an attribute name for a Core Data entity? In Xcode 3 there was no warning...any idea why?
The exact warning is: Naming Conflict: imageTitle conflicts with a method already on NSObject or NSManagedObject
Very annoying is that I get this warning for every single past Model Version...
Any idea how I get rid of these warnings for past Model Versions?EDIT: You easily can reproduce this warning, if you create a new project using the "Navigation-based Application" with CoreData support and adding j开发者_开发知识库ust the attribute "imageTitle"...
I can't answer why imageTitle is specifically targeted. My only guess is that it conflicts with some internal method or core data attribute.
In the past, if you had a core data attribute that used one of the reserved words, Xcode would let you build and your project would display very strange behavior. The most common example is "description". Cocoa assumes that description returns an NSString that describes your object, usually for logging. If you had a dynamically generated core data attribute named description, then bad things would happen. Especially if it was data or transformable.
Current versions of Xcode give the same error dialog if you try to name an attribute description.
While this is irritating, I highly recommend changing your attribute name to something else, such as pictureTitle or imageTitleString. Even though "imageTitle" doesn't get many hits in the documentation, it likely conflicts with something internal.
As a last resort, file a bug with Apple. It may actually just be a bug in Xcode.
精彩评论