Hi all,
I'm making an NSDictionary from an XML file.
But I'm having trouble going through the dictionary.
The xml generator
Thats how I generate XML. That goes fine.
This is the result in NSDictionary:
This part pretty ok..
What is the best way to loop through all the 'company' records, and so make a simple list like..
Company0 : Name = Company0 : Description = Test Company0
Company1 : Name = Company1 : Description = Test Company1
Company2 : Name = Company2 : Description = Test Company2
I'd like to understand this... 'multi-dimensional arrays'. But not sure how to call to it, and googling doesnt make much sense.
Thanks!
I'm making an NSDictionary from an XML file.
But I'm having trouble going through the dictionary.
The xml generator
Code:
echo '<companies>';
for($i=0;$i<3;$i++) {
echo '<company' . $i . '><name>Company' . $i . '</name><description>Test copmany' . $i . '!</description><coords>51.12312,004.123123</coords></company' . $i . '>';
}
echo '</companies>';
Thats how I generate XML. That goes fine.
This is the result in NSDictionary:
Code:
{
companies = {
company0 = {
coords = {
text = "51.12312,004.123123";
};
description = {
text = "Test copmany0!";
};
name = {
text = Company0;
};
};
company1 = {
coords = {
text = "51.12312,004.123123";
};
description = {
text = "Test copmany1!";
};
name = {
text = Company1;
};
};
company2 = {
coords = {
text = "51.12312,004.123123";
};
description = {
text = "Test copmany2!";
};
name = {
text = Company2;
};
};
};
}
This part pretty ok..
What is the best way to loop through all the 'company' records, and so make a simple list like..
Company0 : Name = Company0 : Description = Test Company0
Company1 : Name = Company1 : Description = Test Company1
Company2 : Name = Company2 : Description = Test Company2
I'd like to understand this... 'multi-dimensional arrays'. But not sure how to call to it, and googling doesnt make much sense.
Thanks!
Last edited: