I am converting my project to ARC and Xcode thinks there is a memory leak here, does anyone see anything wrong with this? I didn’t write this code so I am not familiar with C calls.
- (NSString*) URLEscaped
{
NSString *encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(CFStringRef)self,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8);
return encodedString;
}
From the docs:
Yes, you’re leaking a
CFStringthere.