Wednesday, 19 November 2014

URL encoding in iPhone programming (iOS Progarmming) using NSString Category ARC enabled

@implementation NSString (URLEncoding)

- (NSString *)encodeString//:(NSStringEncoding)encoding
{
    
    return (NSString *) CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self,
                                                                                  NULL, (CFStringRef)@";/?:@&=$+{}<>,",
                                                                                  CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)));
}

@end

No comments:

Post a Comment