pinku
pinku

Reputation: 57

How to parse XML array in iPhone?

I am doing parsing, in my parsearray having only two data number of alerts and number of events these are fine. When we are finding the value like

NSString *alertcount = [[xmlparseArray objectAtIndex:indexPath.row ]objectForKey:@"alerts"];

and assigning these string value into label

mylabel.text = [NSString stringWithFormat:@"%@", alertcount];

same for Events.

then it becomes crash. It says:

index 0 beyond out of empty Array

And these parsing I am using in @RootViewController:

UITableViewController {


}

not using custom cell. In this rootviewcontroller class we are using 7 row(these are constant) and I want to assign at row number 5 the value of alert (i.e. mylabel.text = [NSString stringWithFormat:@"%@", alertcount]) at the right position of cell number 5 same is cell number 6.

Upvotes: 0

Views: 144

Answers (1)

visakh7
visakh7

Reputation: 26400

Your xmlparseArray might be empty. Check if you have any elements in the array. Pls show the code where you populate the array so that we can have a better idea of where you are going wrong

Upvotes: 1

Related Questions