【问题标题】:Decode base64 string for image解码图像的base64字符串
【发布时间】:2014-04-14 13:53:02
【问题描述】:

我在 base64 中编码了字符串并想对其进行解码,但在NSData *decodedData 中得到了nilNSString *images 包含编码字符串。

NSString *images = encoded string;
NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:images options:0];
UIImage *myImage = [UIImage imageWithData:decodedData];

【问题讨论】:

    标签: ios base64 nsdata decode


    【解决方案1】:

    也许你有未知字符?尝试将NSDataBase64DecodingIgnoreUnknownCharacters 传递给options: 参数。

    【讨论】:

      猜你喜欢
      • 2014-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多