indexpath.row for array b.tag
0 Date1 0
1 india 1
2 pakistan 2
3 Date2 3
4 Zimbabwe 3
5 England 4
6 Date3 6
7 Australia 5
8 Westindes 6
9 Date3 9
10 Shrilanka 7
11 southAfrica 8
Here, indexpath.row for array is my Array. Now when i click on b.tag=3 then I want to display Array index 4th value i.e Zimbabwe and not the Date2 which is on array index 3. Similarly, for b.tag=6 and b.tag=9. For that following is the code that i have written.
please take a look…
if (b.tag!=[arr objectAtIndex:path])
{
NSLog(@"Team name %@",[arr objectAtIndex:b.tag]);
}
From the above code my first record result is coming right i.e of b.tag=1 and b.tag=2,but not for others because my Array index and b.tag are different. So please help me out of this.
Any help will be appreciated.
Thanks in Advance.
Why not change the contents of the array to better reflect your button tags?
It seems you have two different data types represented by one array, split them out: