核心数据分配 - 值而不是地址

时间:2013-08-29 22:19:27

标签: core-data memory-address assign

我正在为3个objChordFun(核心数据对象)属性赋值。问题是程度属性。它的内容正在循环中的某个地方释放。怎么了?我会感激一些帮助。

    for (TonalScale *tonalScale in [TonalScale all]) {  
        NSOrderedSet *tsScales = [NSOrderedSet orderedSetWithOrderedSet:tonalScale.scale];  
        Scale *tsScale = [tsScales objectAtIndex:0];  
        NSOrderedSet *degrees = tsScale.degree;  
        for (int i=0; i<[tsScale.degree count]; i++) {  
            Degree *degree = [degrees objectAtIndex:i];  
            Scale *scale = [tsScales objectAtIndex:i];  
            NSSet *chords = [NSSet setWithSet:scale.chord];  
            for (Chord *chord in chords) {  
                for (Tonality *tlt in [Tonality all]) {  
                    objChordFun = [ChordFunction create];  
                    objChordFun.degree = degree;  
                    objChordFun.chord = chord;  
                    objChordFun.tonality = tlt;  
                }  
            }  
        }  
    }  

0 个答案:

没有答案