Base64 icon indicating copy to clipboard operation
Base64 copied to clipboard

EXC

Open MangeshVyas opened this issue 11 years ago • 8 comments

+ (NSString *)stringWithBase64EncodedString:(NSString *)string
{
    NSData *data = [NSData dataWithBase64EncodedString:string];
    if (data)
    {
        return [[self alloc] initWithData:data encoding:NSUTF8StringEncoding];
    }
    return nil;
}

screen shot 2014-02-07 at 3 36 01 pm

MangeshVyas avatar Feb 07 '14 10:02 MangeshVyas

There is no need to use this library any more. See here for how to use the built-in Base64 apis instead (iOS 4 and up).

http://iosdevelopertips.com/best-practices/eveything-you-need-to-know-about-ios-and-os-x-deprecated-apis.html

nicklockwood avatar Feb 07 '14 10:02 nicklockwood

Thanks Nicklockwood, But I am getting this issue on iOS 6.

MangeshVyas avatar Feb 07 '14 10:02 MangeshVyas

Are you using ARC?

nicklockwood avatar Feb 07 '14 11:02 nicklockwood

Yes

MangeshVyas avatar Feb 07 '14 11:02 MangeshVyas

Hmm. I can't see any reason why that would crash. Are you able to send me a project that demonstrates the issue?

nicklockwood avatar Feb 07 '14 11:02 nicklockwood

It is working in all other places like encoding image and other text but in case of decoding "bankCode":"dGVzdA==" app getting crash , while i am able to decode this string online.

MangeshVyas avatar Feb 07 '14 14:02 MangeshVyas

Ahhhhhh, Thanks nicklockwood for your kind suport and prompt response. i resolved this issue. It is due to build setting I enable Guard malloc and Zommbie object and Log exception in build setting. Once i remove this check it start working. Thank You

MangeshVyas avatar Feb 07 '14 14:02 MangeshVyas

No problem, glad you found a solution :-)

nicklockwood avatar Feb 07 '14 14:02 nicklockwood