Browse files

Fixed FSN Issue #10

- FSN_categories.h did not have a [NSArray urlEncodedString] impl.
  • Loading branch information...
1 parent 305a5f4 commit c55651c86293f8415a57aa9e0e720c2311e820b7 @adamalix adamalix committed Feb 21, 2013
Showing with 19 additions and 0 deletions.
  1. +5 −0 src/FSN_categories.h
  2. +14 −0 src/FSN_categories.m
View
5 src/FSN_categories.h
@@ -199,6 +199,11 @@ BOOL httpCodeIsOfClass(int httpCode, FSNHTTPCodeClass httpClass);
@end
+@interface NSArray (FSN)
+
+- (NSString *)urlEncodedString;
+
+@end
@interface NSString (FSN)
View
14 src/FSN_categories.m
@@ -193,7 +193,21 @@ - (NSData *)UTF8Data {
@end
+@implementation NSArray (FSN)
+- (NSString *)urlEncodedString {
+ BOOL firstPass = YES;
+ NSMutableString *base = [NSMutableString new];
+ for (id obj in self) {
+ if (!firstPass)
+ [base appendString:@","];
+ [base appendString:[obj urlEncodedString]];
+ firstPass = NO;
+ }
+ return base;
+}
+
+@end
@implementation NSNumber (FSN)

0 comments on commit c55651c

Please sign in to comment.