mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Added back predicateForSearchWithText:searchMode: and added documentation
This commit is contained in:
@@ -53,6 +53,20 @@
|
||||
*/
|
||||
+ (NSArray *)searchableAttributes;
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Obtaining a Search Predicate
|
||||
///-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
A predicate that will search for the specified text with the specified mode. Mode can be
|
||||
configured to be RKSearchModeAnd or RKSearchModeOr.
|
||||
|
||||
@return A predicate that will search for the specified text with the specified mode.
|
||||
@see RKSearchMode
|
||||
*/
|
||||
|
||||
+ (NSPredicate *)predicateForSearchWithText:(NSString *)searchText searchMode:(RKSearchMode)mode;
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Managing the Search Words
|
||||
///-----------------------------------------------------------------------------
|
||||
|
||||
@@ -35,6 +35,17 @@
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
+ (NSPredicate *)predicateForSearchWithText:(NSString *)searchText searchMode:(RKSearchMode)mode
|
||||
{
|
||||
if (searchText == nil) {
|
||||
return nil;
|
||||
} else {
|
||||
RKManagedObjectSearchEngine *searchEngine = [RKManagedObjectSearchEngine searchEngine];
|
||||
searchEngine.mode = mode;
|
||||
return [searchEngine predicateForSearch:searchText];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)refreshSearchWords
|
||||
{
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
Reference in New Issue
Block a user