How to resolve a NULL cString crash

Posted by hanumanDev on Stack Overflow See other posts from Stack Overflow or by hanumanDev
Published on 2013-02-03T14:57:20Z Indexed on 2013/07/02 11:05 UTC
Read the original article Hit count: 477

Filed under:
|
|
|

I'm getting a crash with the following encoding fix I'm trying to implement:

  // encoding fix
    NSString *correctStringTitle = [NSString stringWithCString:[[item objectForKey:@"main_tag"] cStringUsingEncoding:NSISOLatin1StringEncoding] encoding:NSUTF8StringEncoding];

    cell.titleLabel.text = [correctStringTitle capitalizedString];

my crash log output states:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithCString:encoding:]: NULL cString'

thanks for any help

© Stack Overflow or respective owner

Related posts about ios

Related posts about objective-c