I am trying to convert my code to ARC and I have problem with NSMakeCollectable in the ASIRequest library.
- (NSString*)encodeURL:(NSString *)string
{
N
NSMakeCollectable
is no longer required in ARC. You can use CFBridgingRelease
here.
- (NSString*)encodeURL:(NSString *)string
{
NSString *newString = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &'()*+,;=\"<>%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding([self stringEncoding])));
// or NSString *newString = (__bridge_transfer NSString*)(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &'()*+,;=\"<>%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding([self stringEncoding]));
if (newString) {
return newString;
}
return @"";
}