Please an help to iterate literal dictionary on cappuccino environment.Thanks
var userDict = @{@"name": @"Jack",@"secondName": @"Buck",@"name": @"Jacob",@"secondName": @"Smith"};
for (var righe in userDict){
console.log(righe.name + righe.secondName);
}
output NaN
I'd probably do something like this:
But your dictionary looks wrong; this:
Will overwrite the
nameandsecondNameindices and result in:You probably wanted a
CPArrayofCPDictionary:Then if you loop over
users; you get one user dictionary for each step in the loop, and you can address its ' indices (properties). Since bothCPArrayandCPDictionaryare tollfree-bridged to their native javascript counterparts, you can still do this:Hope this helps.