Can I put different types of objects in the same NSMutableArray?

蓝咒 提交于 2019-12-03 11:09:12

Yes. No limitations. The only thing you have to be careful of is when you retrieve items from the array to verify their class (if necessary) before starting to use them.

Yes.

This may be the shortest answer I've ever posted.

You can put objects of different classes. They just need to inherit from NSObject. Don't forget to release after adding to the array.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!