Cherif
Cherif

Reputation: 5383

Xcode 6: attribute error when compiling a NSManagedObject class

In my coreData model I have defined an entity MyEnity with several attributes. Among them two attibutes :

mute : Boolean 
deleted : Boolean

I have a NSManagedObject class associated with MyEntity. In this class I have :

@NSManaged var mute: NSNumber
@NSManaged var deleted: NSNumber // compilation error

But the second line produces an error and can't be compiled. This is the error I get :

Property 'deleted' with type 'NSNumber' cannot override a property with type 'Bool'

I don't understand what is the issue and why I don't have the same issue for the mute attribute ?

Upvotes: 1

Views: 310

Answers (1)

Zell B.
Zell B.

Reputation: 10296

NSManagedObject has a property named deleted as shown here so using deleted variable name will override that property, in your case with inappropriate type (NSNumber instead of Bool) and thats cause a compile time error

Upvotes: 3

Related Questions