キーと値のペアを使用して for ループから NSMutabledictionary に値を追加したいですか?
現在、このコードを使用しています
for(int j=0;j<[array count];j++){
for(int l=0;l<array2 count] ;l++){
// retreive the category from plist ,then check whether its matching with "catid"
NSString *temp=[NSString stringWithFormat:@"%@",allBookPlist[@"listbook"][j][@"cate"][l][@"categories"]];
if([catId isEqualToString:temp]){
// "catid" is matching with temp then ,retreive the corresponding bid from plist
NSString *str=[NSString stringWithFormat:@"%@",allBookPlist[@"listbook"][j][@"bid"]];
// add that value "bid" and key "catid" to a mutabledictionary
NSMutableDictionary *m=[[NSMutableDictionary alloc]init];
[m setValue:str forKey:catId];
}
}
}
結果は、最終的な辞書「m」の値が最新の値に置き換えられるたびに得られますが、すべての値をまとめたいですか?
このような出力を得ようとしています