I have an array of dictionaries and in it I have a key value that is an Integer, I would like to compaire this keyvalue against another int like so…
while ([myInt != [[sortedArray valueForKey:@"MODID"] objectAtIndex:count]]) {
The plan is that i loop though the array of dictionary until I find an entry that matches they i pass the count value over to where I need to use it.
However I am getting this as my warning…. and then when its executed it never finds a value that matches..
Comparison between pointer and integer ('int' and 'id')
and I also get a error on the same line
Implicit conversion of 'int' to 'id' is disallowed with ARC
The problem is, you cannot store a primitive in a dictionary. So you will never be able to correctly compare like that. What is happening there is you are comparing an address for an object with an it. very unlikely to match.
Use the following to get the integer value for the dictionary object
I would go for something like this, based on what i can tell of your data structure.