0

我有一个名为Message的核心数据生成类。消息有一个消息属性,出于某种原因在Swift中无法访问。Swift Generated Header Missing Objective-C属性

你可以清楚地看到这里的讯息财产在头文件 You can clearly see the message property here in the header file

在消息的斯威夫特延长我无法访问消息属性 In a Swift extension of Message I'm unable to access the message property

在周围挖我进一步发现,该属性甚至不存在于Message + CoreDataProperties.h的相应Swift文件中。

Upon digging around further I found that the property doesn't even exist in the corresponding generated Swift file for Message+CoreDataProperties.h

任何人都可以解释为什么发生这种情况,以及如何解决它?

回答

0

您不定义消息的类型,它是数据类型,将其初始化它

+0

该类型在objective-c标头中定义。你可以在第一张截图中看到。 '@property(nullable,nonatomic,retain)NSString * message' –