为什么在Xcode 6里强引用循环没有Graph显示

我想在Xcode 6里测试Retain Cycle,使用Xcode的Leaks Instrument去观察内存泄漏情况

1.我写了2个类,TTChild和TTParent,头文件如下

@interface TTParent : NSObject

@property (nonatomic,strong) NSMutableArray *children;

@end

@interface TTChild : NSObject

@property (nonatomic,strong) TTParent *parent;

@end

2.然后在一个按钮的动作方法里写了,如下代码,

  • (IBAction)ClickMe:(id)sender {

    TTParent *parent = [[TTParent alloc] init];
    parent.children = [[NSMutableArray alloc] init];
    for (int i = 0; i < 1000; i++) {
    TTChild *child = [[TTChild alloc] init];
    child.parent = parent;
    [parent.children addObject:child];
    }
    }

3.用Instruments依次选择Leaks-> Cycles&Roots->Leaks cycle,点击多次按钮,
出现红色的内存泄露标志,但在Graph里什么都没有显示,上面的代码不是应该有
强引用循环吗,Graph应该有显示啊,为什么没有呢,有人知道这是什么原因吗,
谁能解释一下?

是循环引用,但Instrument不一定显示

看下是不是你的child和parent存在循环引用

应该是存在循环互相引用了

你的意思是。。。
@property (nonatomic,strong) TTParent *parent;

(IBAction)ClickMe:(id)sender {
TTParent *parent = [[TTParent alloc] init];
parent.children = [[NSMutableArray alloc] init];
self.parent = parent;
for (int i = 0; i < 1000; i++) {
TTChild *child = [[TTChild alloc] init];
child.parent = parent;
[self.parent.children addObject:child];
}
}