From a605f10637ef9c2d7639b9809717c8d123e0394a Mon Sep 17 00:00:00 2001 From: Larry Legend Date: Sun, 31 Aug 2014 10:12:18 -0400 Subject: [PATCH 1/3] Silence warning by using 'numberWithUnsignedInt:' to match NSUInteger return type of -[NSArray count]. --- Classes/CSCountMapper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/CSCountMapper.m b/Classes/CSCountMapper.m index 594c874..6b1d6bd 100644 --- a/Classes/CSCountMapper.m +++ b/Classes/CSCountMapper.m @@ -13,7 +13,7 @@ @implementation CSCountMapper + (NSNumber *)transformValue:(NSArray *)inputValue { NSAssert([inputValue isKindOfClass:[NSArray class]], @"Input Value needs to be Array"); - return [NSNumber numberWithInt:[inputValue count]]; + return [NSNumber numberWithUnsignedInt:[inputValue count]]; } @end From 687c18c89b749f31de5055c1aacc13e7c4dfd3b4 Mon Sep 17 00:00:00 2001 From: Larry Legend Date: Sun, 31 Aug 2014 10:21:38 -0400 Subject: [PATCH 2/3] Use numberWithUnsignedLong: which is the correct one to use (not numberWithUnsignedInt:). --- Classes/CSCountMapper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/CSCountMapper.m b/Classes/CSCountMapper.m index 6b1d6bd..ed2f9d9 100644 --- a/Classes/CSCountMapper.m +++ b/Classes/CSCountMapper.m @@ -13,7 +13,7 @@ @implementation CSCountMapper + (NSNumber *)transformValue:(NSArray *)inputValue { NSAssert([inputValue isKindOfClass:[NSArray class]], @"Input Value needs to be Array"); - return [NSNumber numberWithUnsignedInt:[inputValue count]]; + return [NSNumber numberWithUnsignedLong:[inputValue count]]; } @end From 4283d2eef013ea2c5445eaa8783df048ff5d6e72 Mon Sep 17 00:00:00 2001 From: Larry Legend Date: Sun, 7 Sep 2014 19:06:54 -0400 Subject: [PATCH 3/3] If API returns null for a string attribute, map it to nil instead of an NSString containing the 6-character string "". --- Classes/NSObject+CSAPI.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/NSObject+CSAPI.m b/Classes/NSObject+CSAPI.m index ad67e19..3441093 100644 --- a/Classes/NSObject+CSAPI.m +++ b/Classes/NSObject+CSAPI.m @@ -262,6 +262,10 @@ - (NSNumber *)NSNumberValue { */ - (NSString *)NSStringValue { if ([self isKindOfClass:[NSObject class]]) { + if ([self isKindOfClass:[NSNull class]]) { + return nil; + } + NSString *retval = [NSString stringWithFormat:@"%@", self]; return retval;