SCArrayOfObjectsSection

@interface SCArrayOfObjectsSection : SCArrayOfItemsSection

This class functions as an SCTableViewModel section that is able to represent an array of any kind of objects and automatically generate its cells from these objects. In addition, ‘SCArrayOfObjectsSection’ 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. If more than one type of object is present in the items array, then their respective class definitions should be added to the itemsClassDefinitions set.

See

SCObjectSection, SCObjectCell.

Creation and Initialization

  • Allocates and returns an initialized ‘SCArrayOfObjectsSection’ given a header title and an array of objects. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: sectionItems A mutable array of objects that the section will use to generate its cells.
    • - parameter: definition The definition of the objects in the objects array. If the array contains more than one type of object, then their respective definitions must be added to the itemsDefinitions dictionary after initialization.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                                     items:(NSMutableArray *)sectionItems
                           itemsDefinition:(SCDataDefinition *)definition;
  • Returns an initialized ‘SCArrayOfObjectsSection’ given a header title and an array of objects. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: sectionItems A mutable array of objects that the section will use to generate its cells.
    • - parameter: definition The definition of the objects in the objects array. If the array contains more than one type of object, then their respective definitions must be added to the itemsDefinitions dictionary after initialization.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                                  items:(NSMutableArray *)sectionItems
                        itemsDefinition:(SCDataDefinition *)definition;

STVCoreData

  • Allocates and returns an initialized ‘SCArrayOfObjectsSection’ given a header title and an entity definition.

    Note

    This method creates a section with all the objects that exist in classDefinition’s entity’s managedObjectContext. To create a section with only a subset of these objects, consider using the other section initializers.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                          entityDefinition:(SCEntityDefinition *)definition;

    Parameters

    sectionHeaderTitle

    A header title for the section.

    definition

    The entity definition of the objects to fetch.

  • Allocates and returns an initialized ‘SCArrayOfObjectsSection’ given a header title, an entity definition, and an NSPredicate. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: definition The entity definition of the objects to fetch.
    • - parameter: predicate The predicate that will be used to filter the fetched objects.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                          entityDefinition:(SCEntityDefinition *)definition
                           filterPredicate:(NSPredicate *)predicate;
  • Returns an initialized ‘SCArrayOfObjectsSection’ given a header title and an entity definition.

    Note

    This method creates a section with all the objects that exist in classDefinition’s entity’s managedObjectContext. To create a section with only a subset of these objects, consider using the other section initializers.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                       entityDefinition:(SCEntityDefinition *)definition;

    Parameters

    sectionHeaderTitle

    A header title for the section.

    definition

    The entity definition of the objects to fetch.

  • Returns an initialized ‘SCArrayOfObjectsSection’ given a header title, an entity definition, and an NSPredicate. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: definition The entity definition of the objects to fetch.
    • - parameter: predicate The predicate that will be used to filter the fetched objects.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                       entityDefinition:(SCEntityDefinition *)definition
                        filterPredicate:(NSPredicate *)predicate;