Hello, i have the following code :
NSDictionary *dict =[[NSDictionary alloc]initWithObjectsAndKeys:myarray1,@"array1",myarray2,@"array2",nil];
NSArray *shorts=[[dict allKeys]sortedArrayUsingSelector:@selector(compare:)];
for(NSString *dir in shorts){
NSArray *tempArr=[dict objectForKey:dir];
for(NSString *file in tempArr ){
NSLog(@"%@",file);
}
}
Where myarray1 and myarray2 are NSArrays...When i execute the following code the application crashes with
-[NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x1d134
This is apparently the tempArr , which is not recognized as a NSArray... I know that [dicFiles objectForKey:dir] return an 'id' type object but as a generic type , i cannot get what i'm doing wrong ...
Any help appreciated