IOS How to encode url

/* encode url when request to server */
+ (NSString *) urlEncode:(NSString *)string {
    NSString *urlEn = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)string, NULL,
                                                                         (CFStringRef)@"!*'();:@&=+$,/?%#[]",
                                                                         kCFStringEncodingUTF8 );
    return urlEn;

}

Comments

Popular posts from this blog

Java : Variables Declaring

SQL Self JOIN