NSPredicate compare with Integer

NSNumber is an object type. Unlike NSString, the actual value of NSNumber is not substitued when used with %@ format. You have to get the actual value using the predefined methods, like intValue which returns the integer value. And use the format substituer as %d as we are going to substitute an integer value.

The predicate should be,

predicateWithFormat:@"userID == %d", [stdUserNumber intValue]];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)