0

Here is my code:

- (void)showRectangles
{
  NSMutableArray *rects = [[NSMutableArray alloc]init];
  //....rest of code here
  [rects release];
}

The problem here is that when I analyze the code, it gives me this warning:

Incorrect decrement of the reference count of an object that is not owned at this point by the caller

I don't understand why this gives me a warning. Can anyone explain why?

4

1 回答 1

1

通过在问题导航器中展开消息,xcode 将为您指出每个 ref count 操作。最终,这将向您展示静态分析器是如何得出这个结论的。

或者,您可能在此过程中重新分配了变量rects(引入了泄漏和过度释放)。

于 2012-07-23T06:02:26.387 回答