ASIFormDataRequest: setPostValue:forKey now takes any object that conforms to the NSObject protocol
Thanks to EgoAleSum for this suggestion!
Showing
4 changed files
with
5 additions
and
5 deletions
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | #pragma mark setup request | 21 | #pragma mark setup request |
22 | 22 | ||
23 | // Add a POST variable to the request | 23 | // Add a POST variable to the request |
24 | -- (void)setPostValue:(id)value forKey:(NSString *)key; | 24 | +- (void)setPostValue:(id <NSObject>)value forKey:(NSString *)key; |
25 | 25 | ||
26 | // Add the contents of a local file to the request | 26 | // Add the contents of a local file to the request |
27 | - (void)setFile:(NSString *)filePath forKey:(NSString *)key; | 27 | - (void)setFile:(NSString *)filePath forKey:(NSString *)key; |
@@ -30,12 +30,12 @@ | @@ -30,12 +30,12 @@ | ||
30 | 30 | ||
31 | #pragma mark setup request | 31 | #pragma mark setup request |
32 | 32 | ||
33 | -- (void)setPostValue:(id)value forKey:(NSString *)key | 33 | +- (void)setPostValue:(id <NSObject>)value forKey:(NSString *)key |
34 | { | 34 | { |
35 | if (!postData) { | 35 | if (!postData) { |
36 | postData = [[NSMutableDictionary alloc] init]; | 36 | postData = [[NSMutableDictionary alloc] init]; |
37 | } | 37 | } |
38 | - [postData setValue:value forKey:key]; | 38 | + [postData setValue:[value description] forKey:key]; |
39 | [self setRequestMethod:@"POST"]; | 39 | [self setRequestMethod:@"POST"]; |
40 | } | 40 | } |
41 | 41 |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | // asi-http-request | 3 | // asi-http-request |
4 | // | 4 | // |
5 | // Created by Ben Copsey on 09/07/2008. | 5 | // Created by Ben Copsey on 09/07/2008. |
6 | -// Copyright __MyCompanyName__ 2008. All rights reserved. | 6 | +// Copyright 2008 All-Seeing Interactive. All rights reserved. |
7 | // | 7 | // |
8 | 8 | ||
9 | #import <Cocoa/Cocoa.h> | 9 | #import <Cocoa/Cocoa.h> |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | // asi-http-request | 3 | // asi-http-request |
4 | // | 4 | // |
5 | // Created by Ben Copsey on 09/07/2008. | 5 | // Created by Ben Copsey on 09/07/2008. |
6 | -// Copyright __MyCompanyName__ 2008. All rights reserved. | 6 | +// Copyright 2008 All-Seeing Interactive. All rights reserved. |
7 | // | 7 | // |
8 | 8 | ||
9 | #import <UIKit/UIKit.h> | 9 | #import <UIKit/UIKit.h> |
-
Please register or login to post a comment