NSDictionary(key与value)
1.key与value关系,用一个key的值控制整个模型
NSDictionary *dic = @{@"channelKey":channelModel,@"channelIndexKey":[NSString stringWithFormat:@"%ld",i],channelModel.channelId:columnList };
key是@“channelKey”,value对应的是一个模型channelModel存储所有的栏目,
key是@“channelIndexKey”,value对应的是频道的索引.
key是channelModel.channelId 频道id ,value对应的是所有栏目的模型
2.NSDictionary *dic =@{@"你好",@"name"};
key 是name, value @"你好"
结果:
{
5976 = (
"<WJNewsChannelModel: 0x170462400>",
"<WJNewsChannelModel: 0x170462300>",
);
channelIndexKey = 1;
channelKey = "<WJNewsChannelModel: 0x1742680c0>";
}
将来的自己,会感谢现在不放弃的自己!