From 00a89d3a4bf64c7c8c39155ece3788a9692ddb01 Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Fri, 24 Aug 2012 13:15:43 -0400 Subject: [PATCH] Add count method to RKMappingResult --- Code/ObjectMapping/RKMappingResult.h | 1 + Code/ObjectMapping/RKMappingResult.m | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Code/ObjectMapping/RKMappingResult.h b/Code/ObjectMapping/RKMappingResult.h index ea8940e7..f90d9b5c 100644 --- a/Code/ObjectMapping/RKMappingResult.h +++ b/Code/ObjectMapping/RKMappingResult.h @@ -32,5 +32,6 @@ - (id)asObject; - (NSArray *)asCollection; - (NSError *)asError; +- (NSUInteger)count; @end diff --git a/Code/ObjectMapping/RKMappingResult.m b/Code/ObjectMapping/RKMappingResult.m index bc089177..974d1840 100644 --- a/Code/ObjectMapping/RKMappingResult.m +++ b/Code/ObjectMapping/RKMappingResult.m @@ -106,4 +106,9 @@ return [NSString stringWithFormat:@"<%@: %p, results=%@>", NSStringFromClass([self class]), self, self.keyPathToMappedObjects]; } +- (NSUInteger)count +{ + return [[self asCollection] count]; +} + @end