I get this a runtime error
runtime error: Thread 1: "-[Attribute setImageD:]: unrecognized selector sent to instance 0x6000034aabc0"
when running my code. When assigning the field see * * *
Some background, this started in my project so I striped my code to the minimum but still get this error,
CORE DATA DEFINITION
______________________________
extension Attribute {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Attribute> {
return NSFetchRequest<Attribute>(entityName: "Attribute")
}
@NSManaged public var name: String
@NSManaged public var order: Int32
@NSManaged public var item: Item
@NSManaged public var imageD: Data?
}
_____________________________
IN THE CALLING CODE I GET THE IMAGE ND CONVERT TO DATA, PASSING IN TO THE SAVING ROUTINE
let image = UIImage(named: "BartSimpson");
let imagedata = image?.jpegData(compressionQuality: 1)
= Attribute.createPhotoAttributeFor(item: item,
imageData: imagedata!)
CoreData.stack.save()
_________________________
HERE THE SAVING METHOD GETS A RUNTUME ERROR WHEN TYPING TO SET THE IMAGED FIELD USINNG THE IMAGEDATE... SEE ***
class func createPhotoAttributeFor(item: Item, imageData: Data) -> Attribute {
let attribute = Attribute.newAttribute()
attribute.name = "image"
attribute.imageD = imageData // attribute value
attribute.order = 3 // 3 = image
attribute.item = item // parent record
return attribute
}
WHAT AM I DOING WRONG?
THANKS
MARK
runtime error: Thread 1: "-[Attribute setImageD:]: unrecognized selector sent to instance 0x6000034aabc0"
when running my code. When assigning the field see * * *
Some background, this started in my project so I striped my code to the minimum but still get this error,
CORE DATA DEFINITION
______________________________
extension Attribute {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Attribute> {
return NSFetchRequest<Attribute>(entityName: "Attribute")
}
@NSManaged public var name: String
@NSManaged public var order: Int32
@NSManaged public var item: Item
@NSManaged public var imageD: Data?
}
_____________________________
IN THE CALLING CODE I GET THE IMAGE ND CONVERT TO DATA, PASSING IN TO THE SAVING ROUTINE
let image = UIImage(named: "BartSimpson");
let imagedata = image?.jpegData(compressionQuality: 1)
= Attribute.createPhotoAttributeFor(item: item,
imageData: imagedata!)
CoreData.stack.save()
_________________________
HERE THE SAVING METHOD GETS A RUNTUME ERROR WHEN TYPING TO SET THE IMAGED FIELD USINNG THE IMAGEDATE... SEE ***
class func createPhotoAttributeFor(item: Item, imageData: Data) -> Attribute {
let attribute = Attribute.newAttribute()
attribute.name = "image"
attribute.imageD = imageData // attribute value
* * runtime error: Thread 1: "-[Attribute setImageD:]: unrecognized selector sent to instance 0x6000034aabc0"
attribute.order = 3 // 3 = image
attribute.item = item // parent record
return attribute
}
WHAT AM I DOING WRONG?
THANKS
MARK