SCArrayOfObjectsModel Class Reference
Inherits from | SCArrayOfItemsModel : SCTableViewModel : NSObject |
Declared in | SCTableViewModel.h |
Overview
This class functions as a table view model that is able to represent an array of any kind of objects and automatically generate its cells from these objects. In addition, ‘SCArrayOfObjectsModel’ generates its detail views from the properties of the corresponding object in its items array. Objects in the items array need not all be of the same object type, but they must all decend from NSObject.
‘SCArrayOfItemsModel’ will automatically generate a set of SCArrayOfObjectsSection(s) if the sectionHeaderTitleForItem modelAction is implemented, otherwise it will only generate a single SCArrayOfObjectsSection.
Tasks
Creation and Initialization
Configuration
-
searchPropertyName
property
STVWebServices Methods
-
+ modelWithTableView:webServiceDefinition:
-
+ modelWithTableView:webServiceDefinition:batchSize:
-
– initWithTableView:webServiceDefinition:
-
– initWithTableView:webServiceDefinition:batchSize:
STVCoreData Methods
-
+ modelWithTableView:entityDefinition:
-
+ modelWithTableView:entityDefinition:filterPredicate:
-
– initWithTableView:entityDefinition:
-
– initWithTableView:entityDefinition:filterPredicate:
STVParse Methods
Properties
searchPropertyName
The name of the object’s property that the value of which will be used to search the items array when the user types a search term inside the model’s associated search bar. To search more than one property value, separate the property names by a semi-colon (e.g.: @“firstName;lastName”). To search all properties in the object’s class definition, set the property to an astrisk (e.g.: @“*”). If the property is not set, it defaults to the value of the object’s class definition titlePropertyName property.
@property (nonatomic, copy) NSString *searchPropertyName
Declared In
SCTableViewModel.h
Class Methods
modelWithTableView:entityDefinition:
Allocates and returns an initialized SCArrayOfObjectsModel given a UITableView and an entity definition.
+ (instancetype)modelWithTableView:(UITableView *)tableView entityDefinition:(SCEntityDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The entity definition of the objects.
Discussion
Note: This method creates a model with all the objects that exist in the definition’s managedObjectContext.
Declared In
SCArrayOfObjectsModel+CoreData.h
modelWithTableView:entityDefinition:filterPredicate:
Allocates and returns an initialized ‘SCArrayOfObjectsModel’ given a UITableView and an entity definition. * * @param tableView The UITableView to be bound to the model. * @param definition The entity definition of the objects. * @param perdicate The predicate that will be used to filter the fetched objects.
+ (instancetype)modelWithTableView:(UITableView *)tableView entityDefinition:(SCEntityDefinition *)definition filterPredicate:(NSPredicate *)predicate
Declared In
SCArrayOfObjectsModel+CoreData.h
modelWithTableView:items:itemsDefinition:
Allocates and returns an initialized ‘SCArrayOfObjectsModel’ given a UITableView and an array of objects.
+ (instancetype)modelWithTableView:(UITableView *)tableView items:(NSMutableArray *)items itemsDefinition:(SCDataDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- items
An array of objects that the model will use to generate its cells. This array must be of type NSMutableArray, as it must support the model’s add, delete, and move operations.
- definition
The definition of the objects in the objects array.
Declared In
SCTableViewModel.h
modelWithTableView:parseDefinition:
Allocates and returns an initialized SCArrayOfObjectsModel given a UITableView and a Parse definition.
+ (instancetype)modelWithTableView:(UITableView *)tableView parseDefinition:(SCParseDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The Parse definition of the objects to fetch.
Discussion
Note: This method creates a model with all the objects that fetched by the Parse definition.
Declared In
SCArrayOfObjectsModel+Parse.h
modelWithTableView:parseDefinition:batchSize:
Allocates and returns an initialized SCArrayOfObjectsModel given a UITableView and a Parse definition.
+ (instancetype)modelWithTableView:(UITableView *)tableView parseDefinition:(SCParseDefinition *)definition batchSize:(NSUInteger)batchSize
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The Parse definition of the objects to fetch.
- batchSize
The size of the batch to be fetched.
Discussion
Note: This method creates a model with all the objects that fetched by the Parse definition.
Declared In
SCArrayOfObjectsModel+Parse.h
modelWithTableView:webServiceDefinition:
Allocates and returns an initialized SCArrayOfObjectsModel given a UITableView and a web service definition.
+ (instancetype)modelWithTableView:(UITableView *)tableView webServiceDefinition:(SCWebServiceDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The web service definition of the objects to fetch.
Discussion
Note: This method creates a model with all the objects that fetched by the web service definition.
Declared In
SCArrayOfObjectsModel+WebServices.h
modelWithTableView:webServiceDefinition:batchSize:
Allocates and returns an initialized SCArrayOfObjectsModel given a UITableView and a web service definition.
+ (instancetype)modelWithTableView:(UITableView *)tableView webServiceDefinition:(SCWebServiceDefinition *)definition batchSize:(NSUInteger)batchSize
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The web service definition of the objects to fetch.
- batchSize
The size of the batch to be fetched.
Discussion
Note: This method creates a model with all the objects that fetched by the web service definition.
Declared In
SCArrayOfObjectsModel+WebServices.h
Instance Methods
initWithTableView:entityDefinition:
Returns an initialized SCArrayOfObjectsModel given a UITableView and an entity definition.
- (instancetype)initWithTableView:(UITableView *)tableView entityDefinition:(SCEntityDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The entity definition of the objects.
Discussion
Note: This method creates a model with all the objects that exist in the definition’s managedObjectContext.
Declared In
SCArrayOfObjectsModel+CoreData.h
initWithTableView:entityDefinition:filterPredicate:
Returns an initialized ‘SCArrayOfObjectsModel’ given a UITableView and an entity definition. * * @param tableView The UITableView to be bound to the model. * @param definition The entity definition of the objects. * @param perdicate The predicate that will be used to filter the fetched objects.
- (instancetype)initWithTableView:(UITableView *)tableView entityDefinition:(SCEntityDefinition *)definition filterPredicate:(NSPredicate *)predicate
Declared In
SCArrayOfObjectsModel+CoreData.h
initWithTableView:items:itemsDefinition:
Returns an initialized ‘SCArrayOfObjectsModel’ given a UITableView and an array of objects.
- (instancetype)initWithTableView:(UITableView *)tableView items:(NSMutableArray *)items itemsDefinition:(SCDataDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- items
An array of objects that the model will use to generate its cells. This array must be of type NSMutableArray, as it must support the model’s add, delete, and move operations.
- definition
The definition of the objects in the objects array.
Declared In
SCTableViewModel.h
initWithTableView:parseDefinition:
Returns an initialized SCArrayOfObjectsModel given a UITableView and a Parse definition.
- (instancetype)initWithTableView:(UITableView *)tableView parseDefinition:(SCParseDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The Parse definition of the objects to fetch.
Discussion
Note: This method creates a model with all the objects that fetched by the Parse definition.
Declared In
SCArrayOfObjectsModel+Parse.h
initWithTableView:parseDefinition:batchSize:
Returns an initialized SCArrayOfObjectsModel given a UITableView and a Parse definition.
- (instancetype)initWithTableView:(UITableView *)tableView parseDefinition:(SCParseDefinition *)definition batchSize:(NSUInteger)batchSize
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The Parse definition of the objects to fetch.
- batchSize
The size of the batch to be fetched.
Discussion
Note: This method creates a model with all the objects that fetched by the Parse definition.
Declared In
SCArrayOfObjectsModel+Parse.h
initWithTableView:webServiceDefinition:
Returns an initialized SCArrayOfObjectsModel given a UITableView and a web service definition.
- (instancetype)initWithTableView:(UITableView *)tableView webServiceDefinition:(SCWebServiceDefinition *)definition
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The web service definition of the objects to fetch.
Discussion
Note: This method creates a model with all the objects that fetched by the web service definition.
Declared In
SCArrayOfObjectsModel+WebServices.h
initWithTableView:webServiceDefinition:batchSize:
Returns an initialized SCArrayOfObjectsModel given a UITableView and a web service definition.
- (instancetype)initWithTableView:(UITableView *)tableView webServiceDefinition:(SCWebServiceDefinition *)definition batchSize:(NSUInteger)batchSize
Parameters
- tableView
The UITableView to be bound to the model.
- definition
The web service definition of the objects to fetch.
- batchSize
The size of the batch to be fetched.
Discussion
Note: This method creates a model with all the objects that fetched by the web service definition.
Declared In
SCArrayOfObjectsModel+WebServices.h