Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的班级中有一个静态数组。我什么时候放出来?或者我不必担心?我正在考虑以 dealloc 方法释放它,但不确定。谢谢
如果它是静态的,则不应释放它。
如果您担心数组占用的内存量(因为它可能很大,并且如果需要,您可以随时重新创建),您可以在收到 didReceiveMemoryWarning 通知时清空数组。否则真的没有理由太在意它。