iOS7 이상
NSString *unescaped = @"http://www";
NSString *charactersToEscape = @"!*'();:@&=+$,/?%#[]\" ";
NSCharacterSet *allowedCharacters = [[NSCharacterSet characterSetWithCharactersInString:charactersToEscape] invertedSet];
NSString *encodedString = [unescaped stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters];
iOS7 이하
NSString *escapedString = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(
NULL,
(__bridge CFStringRef) unescaped,
NULL,
CFSTR("!*'();:@&=+$,/?%#[]\" "),
kCFStringEncodingUTF8));
'iPhone Dev' 카테고리의 다른 글
ios8 registerforremotenotificationtypes (0) | 2014.12.02 |
---|---|
sizeWithFont 대체 (0) | 2014.06.20 |
UILabel의 글자 사이즈 구하기 (0) | 2014.03.13 |
p12 to pem (0) | 2014.02.18 |
[iOS7] status bar textcolor 변경 (0) | 2013.09.25 |