我刚刚走过一条由一位同事撰写的法典,我以前从未在奥杰-C看到过。 它看起来好像是坏的,我想改变它,但它似乎奏效(正像预期的那样运作),我甚至不知道要改变它。
NSString **stringArray= new NSString *[numberOfStrings];
是否是这样? 国家安全局是否更有意义?
EDIT: In order to properly free the array from memory, are any release
calls needed? Currently, all I see is delete [] stringArray;
.
EDIT 2. 这似乎从记忆中适当删除阵列:
for (int i=0; i < numberOfStrings; i++)
{
[stringArray[i] release];
}
delete [] stringArray;