i have this code and searched the internet and find it ok but its not working with me
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
.....
NSLog(@"%@",[dict objectForKey:@"STATUS"]);
if ([[dict objectForKey:@"STATUS"] isEqualToString:@"Y"]) {
NSLog(@"Done");
}
The NSLog Shows Y Which Should Work With if statment
When you do:
i think this is adding the strings to the dictionary as objects. The NSLog line is working because NSLog sends each object it is passed the “description” message to convert it to its string value. you can do the same thing.
try changing this:
to this:
That would get the string value of the object returned by objectForKey: before doing the comparison.
If you think there might be a white space throwing off the compare, trim the string before comparing, like this: