Files
RestKit/Code/Three20/RKFilterableObjectLoaderTTModel.h
Blake Watters f2ceefa012 Merge Request Queue (See issue #75):
* Introduces RKRequestCache for cacheing responses (supports ETag conditional GET, use cache if available, use cache on error, etc.) closes #75
    * Updates to Three20 layer to eliminate need for intermediary TTTableItem classes closes #76
    * Fixes to ensure iOS 3.x compatability:
        * Switched compiler to Clang
        * Updated conditional checks for UIBackgroundTask symbols to ensure runtime safety on iOS 3.x
        * Removed unnecessary linkage against UIKit and CoreFoundation from library targets
    * Fix for issue where RKRequest objects could become stuck in infinite loop within RKRequestQueue loadNextInQueue if you start
      a request and then cancel immediately. On cancel only decrement loadCount if the request has start loading. refs #122
2011-06-11 19:28:44 -04:00

69 lines
1.7 KiB
Objective-C

//
// RKFilterableObjectLoaderTTModel.h
// RestKit
//
// Created by Blake Watters on 2/12/10.
// Copyright 2010 Two Toasters. All rights reserved.
//
#import "RKObjectLoaderTTModel.h"
#import "../Support/RKSearchEngine.h"
/**
* Provides an interface for searching and filtering a collection
* of objects loaded from a remote source
*/
@interface RKFilterableObjectLoaderTTModel : RKObjectLoaderTTModel {
RKSearchEngine* _searchEngine;
NSPredicate* _predicate;
NSArray* _sortDescriptors;
NSString* _searchText;
SEL _sortSelector;
NSArray* _filteredObjects;
}
/**
* A predicate to filter the model objects by
*/
@property (nonatomic, retain) NSPredicate* predicate;
/**
* An array of sort descriptors to sort the objects with
*/
@property (nonatomic, retain) NSArray* sortDescriptors;
/**
* A selector to use in sorting the objects. When present,
* the sortSelector will be used for sorting objects, rather than
* the sortDescriptors.
*/
@property (nonatomic, assign) SEL sortSelector;
/**
* A search engine instance for searching the data. If none is assigned,
* a default search engine will be created for you
*/
@property (nonatomic, retain) RKSearchEngine* searchEngine;
/**
* Creates an RKSearchEngine instance for searching the collection.
*/
- (RKSearchEngine*)createSearchEngine;
/**
* Resets the model by clearing the filter, sort descriptor, and search text
*/
- (void)reset;
/**
* Triggered when the model was search with empty text. Default implementation preserves filtered collection.
*/
- (NSArray*)didSearchCollectionWithEmptyText:(NSArray*)collection;
/**
* Search the model for matching text
*/
- (void)search:(NSString*)text;
@end