【发布时间】:2013-09-26 13:50:32
【问题描述】:
我有以下 For 循环,它遍历核心数据实体,然后检查名为 keyString 的 NSString 是否与属性匹配。如果它确实匹配,那么我想将该实体上的属性设置为另一个名为 value 的 NSString:
NSEntityDescription *entity = [exhibitor entity];
NSDictionary *attributes = [entity attributesByName];
for (NSString *attribute in attributes) {
if ([keyString isEqualToString:attribute]) {
exhibitor.attribute = value; //This bit is wrong.
}
}
问题在于existor.attribute = value 这一行。我需要以某种方式引用参展商的属性对象。有人可以帮忙吗?
【问题讨论】:
标签: ios objective-c xcode core-data nsdictionary