I think this could be a very easy question for you.
But I have searched a lot and I don't know if I am very fool or I am using the wrong class (
NSMutableArray *grisOcurrencias = [[NSMutableArray alloc] init];
[grisOcurrencias setValue:ocurrencia forKey:[NSString stringWithFormat: @"%f", pixelVal]];
[grisOcurrencias addObject: ocurrencia]
You are looking for
NSMutableArray. Dictionaries store objects based on a key, whereas arrays store objects based on an index.
NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [dict setObject:something forKey:@"Some Key"]; // ... and later ... id something = [dict objectForKey:@"Some Key"];