Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (32 sloc) 926 Bytes
//
// SSFilteredResultsFilter.m
// SSDataKit
//
// Created by Sam Soffes on 4/30/12.
// Copyright (c) 2012 Sam Soffes. All rights reserved.
//
#import "SSFilteredResultsFilter.h"
#import "SSFilteredResultsSection.h"
#import <UIKit/UIKit.h>
@implementation SSFilteredResultsFilter
@synthesize predicate = _predicate;
@synthesize sections = _sections;
- (id)objectAtIndexPath:(NSIndexPath *)indexPath {
SSFilteredResultsSection *section = [self.sections objectAtIndex:indexPath.section];
return [section.objects objectAtIndex:indexPath.row];
}
- (NSIndexPath *)indexPathForObject:(id)object {
NSInteger sectionIndex = 0;
for (SSFilteredResultsSection *section in self.sections) {
NSInteger rowIndex = 0;
for (id obj in section.objects) {
if ([obj isEqual:object]) {
return [NSIndexPath indexPathForRow:rowIndex inSection:sectionIndex];
}
rowIndex++;
}
sectionIndex++;
}
return nil;
}
@end
Something went wrong with that request. Please try again.