1.在写如下方法时:
void drawShapes (id shapes[], int count)
{
for (int i = 0; i < count; i++) {
id shape = shapes[i];
[shape draw];
}
}
出现错误:
Must explicitly describe intended ownership of an object array parameter
解决方法:
在工程的Build Settings里面把Automatic Reference Counting这个选项关掉(即设为NO),自己管理内存就不会有这个错误了
本文介绍了一种在Objective-C编程中遇到的内存管理错误'Must explicitly describe intended ownership of an object array parameter'及其解决方法。该错误通常发生在使用ARC(Automatic Reference Counting)时,可以通过关闭项目的Automatic Reference Counting选项并手动管理内存来解决。
2544

被折叠的 条评论
为什么被折叠?



