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' –