Как бы я перебрал следующее NSDictionary
?
2011-10-27 11:40:23.775 Discounts[305:f803] {
NewDataSet = {
Discounts = (
{
BIN = {
text = "\n 900020";
};
DiscountId = {
text = "\n \n d06dab1b-a2a3-464e-a522-00185fcf5e7c";
};
DiscountPrice = {
text = "\n 75%";
};
GRP = {
text = "\n 8013230";
};
PCN = {
text = "\n CLAIMNE";
};
Title = {
text = "\n duralclon";
};
UID = {
text = "\n 100000";
};
text = "\n ";
},
{
BIN = {
text = "\n 900020";
};
DiscountId = {
text = "\n \n 159d9ba9-462c-47a2-a23e-002137c6fd2e";
};
DiscountPrice = {
text = "\n 75%";
};
GRP = {
text = "\n 8013230";
};
PCN = {
text = "\n CLAIMNE";
};
Title = {
text = "\n allermax";
};
UID = {
text = "\n 100001";
};
text = "\n ";
},
...
Я пробовал:
for (id key in discountsDict) {
MyObject *obj = [[MyObject alloc] init];
obj.Title = (NSString *)[key objectForKey:@"Title"]; // *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSCFString 0x6ca2eb0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key Title.'
[self.discounts addObject:obj];
[obj release];
}
Не совсем уверен, собираюсь ли я создать NSArray
с содержимым, а затем перебрать его, чтобы добавить MyObject
к моему NSMutableArray
из self.discounts
.
Заранее спасибо.