Why does overridng the handle delete method and setting it to hidden cause a warning to be generated?
5 次查看(过去 30 天)
显示 更早的评论
Background; I have a reasonably complex set of objects, and a base of 6-7 people interested in them. I've read (anecdotally) that the primary way people explore API's is via tab completion.
I don't want generic matlab handle methods confusing people with what each object does, as opposed to the nature of it being an object. Therefore I want to hide certain methods, for example, the delete method.
classdef SomeClass < handle
methods(Hidden, Access = public)
function delete(varargin)
delete@handle(varargin{:});
end
end
end
Now, this appears to generate a warning;
Warning: The following error was caught while executing 'SomeClass' class destructor:
Method 'delete' is not defined for class 'SomeClass' or is removed from MATLAB's search path.
> In restoredefaultpath (line 52)
In something (line 2)
This method is definitely defined. Can anyone offer feedback on what's happening here, as it appears illogical to me?
1 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Construct and Work with Object Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!