1

I just wanted to predicate my array with Product_Id. I tried like this

NSPredicate *pred=[NSPredicate predicateWithFormat:@"\"Product_Id\" ==%d",[[[_result valueForKey:@"Product_Id"] objectAtIndex:indexPath.row] integerValue]];
predicatedArray = [_likesArray filteredArrayUsingPredicate:pred]; 

_likesArray has below array of dictionary

(
{
    DeviceLikeStatus = 1;
    Msg = "";
    ProductCount = 1;
    "Product_Id" = 116;
}
)

And it is not predicating anything, always showing predicateArray is empty.

1
  • 1
    use "Product_Id" instead of "\"Product_Id\" Commented Jan 2, 2014 at 9:08

1 Answer 1

2

No need of " in the predicate try

NSPredicate *pred=[NSPredicate predicateWithFormat:@"Product_Id ==%d",[[[_result valueForKey:@"Product_Id"] objectAtIndex:indexPath.row] integerValue]];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.