mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-22 20:18:53 +08:00
Drop dead URLEncoding category
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// NSObject+URLEncoding.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Jeff Arena on 7/11/11.
|
||||
// Copyright (c) 2009-2012 RestKit. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
@interface NSObject (URLEncoding)
|
||||
|
||||
/**
|
||||
* Returns a representation of the object as a URLEncoded string
|
||||
*
|
||||
* @returns A UTF-8 encoded string representation of the object
|
||||
*/
|
||||
- (NSString *)URLEncodedString;
|
||||
|
||||
@end
|
||||
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// NSObject+URLEncoding.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Jeff Arena on 7/11/11.
|
||||
// Copyright (c) 2009-2012 RestKit. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSObject+URLEncoding.h"
|
||||
|
||||
|
||||
@implementation NSObject (URLEncoding)
|
||||
|
||||
- (NSString *)URLEncodedString
|
||||
{
|
||||
NSString *string = [NSString stringWithFormat:@"%@", self];
|
||||
NSString *encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,
|
||||
(CFStringRef)string,
|
||||
NULL,
|
||||
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
|
||||
kCFStringEncodingUTF8);
|
||||
return [encodedString autorelease];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user