i'm trying to get object index from array using dictionary key object... but unable to get it.
Here are the details..
I have the Array having dictionaries....
(
{
CATEGORYID = 865;
CATEGORYNAME = "sample1";
CATEGORYTHUMBIMAGEURL = "1.jpg";
},
{
CATEGORYID = 140;
CATEGORYNAME = "sample2";
CATEGORYTHUMBIMAGEURL = "2.jpg";
},
{
CATEGORYID = 1194;
CATEGORYNAME = "sample3";
CATEGORYTHUMBIMAGEURL = "3.jpg";
}
);
Here i have the CATEGORYID.... using category id i need to get the object index at array...
The code i have implemented was...
int inx;
for (int i=0; i<[mutArrData count]; i++) {
NSString *str=(NSString*)[sender tag];
//NSLog(@"MY Str %@",str);
id myOjbect =(id)[sender tag];
//NSLog(@"My OBJECT %d",[myOjbect intValue]);
if ([[[mutArrData objectAtIndex:i] allKeys] containsObject:[NSString stringWithFormat:@"%d",[sender tag]]]) {
inx=i;
NSLog(@"Breaking here %d",inx);
}
}
But unable to get it, can any one help...