핵심 데이터 값이 의도하지 않은 경우 변경되는 문제가 있습니다. 나는 그것을 고칠 수있는 방법에 대한 아이디어를 가지고 있지만, 할 때마다 나는 인식 할 수없는 선택자를 얻는다. 내 생각은 valueArray = attribute.values;
을 valueArray = [NSArray arrayWithArray:attribute.values];
으로 변경하는 것입니다. 도움을 주시면 감사하겠습니다.CoreData 값이 실수로 변경됨
편집 : attribute.values의 합계를 만들려고합니다. 스킬 노드가 있고 각 노드에 속성이 첨부되어 있으며 때때로 그 속성 값이 다릅니다. 나는 모든 같은 가치들을 요약하려고 노력하고있다. 대신, 왜 당신은 단순히 사전에 attributes.values를 추가하지 마십시오 사전에 그것을 추가하기 전에있는 NSArray에 attribute.values 퍼팅의
Build *selectedBuild = [buildListController selectedObjects][0];
NSMutableDictionary *attributeAggregator = nil;
attributeAggregator = [NSMutableDictionary dictionary];
NSLog(@"Before: %@", attributeAggregator);
NSMutableDictionary *numValues = [NSMutableDictionary dictionary];
NSArray *valueArray = nil;
for (SkillNode *active in selectedBuild.activeNodes) {
for (Attribute *attribute in active.attributes) {
NSString *attrName = attribute.name;
NSLog(@"%@ %@", attribute.name, attribute.values);
NSMutableArray *obj = [attributeAggregator objectForKey:attribute.name];
if (obj) {
for (int ndx = 0; ndx < [obj count]; ndx++) {
obj[ndx] = [NSNumber numberWithFloat:([obj[ndx] integerValue] + [attribute.values[ndx] integerValue])];
}
[attributeAggregator setValue:obj forKey:attrName];
} else {
valueArray = attribute.values;
[attributeAggregator setValue:valueArray forKey:attrName];
[numValues setValue:attribute.numValues forKey:attrName];
}
}
}
인식 할 수없는 선택자 오류 란 무엇입니까? – propstm
해제 된 개체에 메시지를 보냅니다. 지정된 메모리에서 오브젝트를 찾을 수 없습니다. – stormbard