我需要注册TCollection和TCollectionItem类,但由于
{TCollection}
property Items [Index: Integer]: TCollectionItem
{TCollectionItem}
property Collection: TCollectionс会立即抛出无法找到TCollectionItem/TCollectionItem类型的异常。
发布于 2016-09-23 18:53:07
如果您在代码中注册自己的类,您可以首先注册TCollectionItem而不注册property Collection: TCollection,然后使用property Items [Index: Integer]: TCollectionItem注册TCollection,然后将property Collection: TCollection添加到您的TCollectionItem中。
发布于 2020-09-12 04:06:10
您可以使用:
type
TCollection = class;
TCollectionItem = class
published
property Items: TCollection;
end;
TCollection = class
published
property Items [Index: Integer]: TCollectionItem;
end;https://stackoverflow.com/questions/39655256
复制相似问题