GTMBase64 icon indicating copy to clipboard operation
GTMBase64 copied to clipboard

'autorelease' is unavailable: not available in automatic reference counting mode

Open datomnurdin opened this issue 10 years ago • 1 comments

I got this error message at line 288

/Users/MNurdin/Documents/iOS/*****/Library/GTMBase64/GTMBase64.m:288:73: 'autorelease' is unavailable: not available in automatic reference counting mode

Source code GTMBase64.m

+(NSString *)stringByEncodingData:(NSData *)data {
    NSString *result = nil;
    NSData *converted = [self baseEncode:[data bytes]
                                  length:[data length]
                                 charset:kBase64EncodeChars
                                  padded:YES];
    if (converted) {
        result = [[[NSString alloc] initWithData:converted
                                        encoding:NSASCIIStringEncoding] autorelease]; //error here
    }
    return result;
}

Please advice. Thank you.

datomnurdin avatar Oct 13 '15 08:10 datomnurdin

sorry, I'm late.

This is because GTMBase64 is old project, does not use ARC,If your project is using ARC,you can check this,disable ARC for a single file in your project : http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project

isaced avatar Nov 06 '15 03:11 isaced