I have an application which is having a dictionary returned from a webservice.and i am passing that dictionary to another view controller.
and in this
NSDictionary *rewards=[rewardsdictionary objectForKey:@"rewards"];
NSLog(@"%@",rewards);
NSMutableArray *dataArray=[[NSMutableArray alloc] init];
for(NSString *key in [rewards allKeys])
{
NSDictionary *dict1=[rewards objectForKey:key];
[dataArray addObject:dict1];
}
self.rewardsarray=[[NSMutableArray alloc] init];
self.rewardsarray=dataArray;
But in this line for(NSString *key in [rewards allKeys]) the application is crashing.but when i am printing rewards or rewards dictionary the values are there.
-[__NSArrayM allKeys]: unrecognized selector sent to instance 0x76636b0
can anybody help me to get out of this?
Obviously,
rewardsis not aNSDictionary. It’s anNSArray.