bool for key in NSMutableArray
I have a code like that
if ([dataArray valueForKey:@"success"]) {
[self.feedsArray addObjectsFromArray:dataArray];
NSLog(@"self.feedsArray: %@",self.feedsArray);
}
else {
NSLog(@"no feed found ");
}
dataArray is a NSMutableArray which ultimately contains a JSON Dictionary.
but I am getting the same console output independent of success either
TRUE or FALSE, but my console output is always same.my console output is:
for FALSE or NO:
self.feedsArray: (
{
action = register;
message = "Invalid parameters";
success = 0;
}
)
and for TRUE or YES:
self.feedsArray: (
{
action = register;
message = "valid parameters";
success = 1;
}
)
in both cases if part is executed.
in NSUserDefaults there is a method boolForKey but how to do this in case
of NSMutableArray.
No comments:
Post a Comment