I want the NSMutableArray only store "MyObject" only... ...instead of any objects. How can I do this? thz.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is no concept like C# Generics or C++ Templates in Objective-C, as discussed here before, but you could create a class which exposes an array and has add and remove-methods which take only your object type (see here).