NSPredicate with core data objects

I have an array which consist of core data class objects. I want to use NSPredicate (for suggestive search) to filter out a particular property of that class.

Requirement I am having a core data classes: AlbumDetails (properties- album name, albumType,etc) i want to access AlbumDetails.AlbumName property using NSPredicate for my search bar text. I currently know using predicate for simple array or dictionary structures, but how can i use predicate for a property of a particular class.


You can use something like

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"albumName contains[cd] %@", searchString];

Where albumName is the property of your class. contains will help you to get all the albums whose name contains the searchString

Need Your Help

php require class call from inside method

php oop class require

from my understanding, require pastes code into the calling php file.