Why does the former of following snippets work while not the latter ?
Snippet 1
NSPredicate *predicate = [NSPredicate predicateWithForma
coin_unique is a key, so it needs the %K format specifier:
coin_unique
%K
NSString *predicateText = @"coin_unique"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(%K == %@)", predicateText, [NSNumber numberWithInt:species]];
The format syntax is described quite well here.