iPhone: Get value in multi-dimentional array
- by Nic Hubbard
I have an array that is many levels deep and I am wondering what is the best way to get one of the child element values that is deep in my array.
I assume I need to use a recursive method, but what is the best way to do this? Or is there a faster way to do this?
The array comes from an XML Parser that I am using which builds everything into an array like this (using NSLog to show the structure):
{
children = (
{
children = (
{
children = (
{
children = (
);
data = 12;
element = AssetID;
}
);
data = "";
element = "ns1:GetUserIdByUsernameResponse";
}
);
data = "";
element = "SOAP-ENV:Body";
}
);
data = "";
element = "SOAP-ENV:Envelope";
}
What I would like to get at is the AssetID data, which in this case is 12.