添加后 delphi TCollection 计数不增加
我有类型
- TNotifyReply = class(TCollectionItem)
- TNotifyReplylist = class(TOwnedCollection)
NotifyReplylist := TNotifyReplylist.Create(self, TNotifyReply);
调用此函数(任意次数)后,计数仍然为零您
function TNotifyReplylist.addItem: TNotifyReply;
begin
Result := inherited Add as TNotifyReply;
OutputDebugString(PAnsiChar('Count > '+ inttostr(count)));
end;
知道这里发生了什么吗?
i have the types
- TNotifyReply = class(TCollectionItem)
- TNotifyReplylist = class(TOwnedCollection)
NotifyReplylist := TNotifyReplylist.Create(self, TNotifyReply);
After calling this function (Any number of times), Count it still zero
function TNotifyReplylist.addItem: TNotifyReply;
begin
Result := inherited Add as TNotifyReply;
OutputDebugString(PAnsiChar('Count > '+ inttostr(count)));
end;
Any idea whats going on here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现问题,TNotifyReply.Create
改为
Found the problem, TNotifyReply.Create was
changed to