I am using [fetchRequest setPredicate:[NSPredicate predicateWithValue:YES]]; to debug my code to by pass universal true predicate. When I exicuting lldb command po [NSPredicate predicateWithValue:YES], it print TRUEPREDICATE.
The return type for predicateWithValue: is NSPredicate.
When I changed it to [fetchRequest setPredicate:TRUEPREDICATE]; Xcode complain a syntax error "use of un-declared identifier"
My question is should I have to import any header file to remove error? If not then how TRUEPREDICATE differ from [NSPredicate predicateWithValue:YES].
A universal true predicate can be created with
[NSPredicate predicateWithValue:YES];
or
[NSPredicate predicateWithFormat:@"TRUEPREDICATE"];
Both statements return the same predicate.
po
prints the description of an object. The description of NSPredicate
is similar to the format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With