gpt4 book ai didi

iphone - XCode 在 NSData+Base64.m 中标记类型错误

转载 作者:行者123 更新时间:2023-11-29 13:26:34 25 4
gpt4 key购买 nike

错误如下图所示 enter image description here

- (id) initWithBase64EncodedString:(NSString *) string {
NSMutableData *mutableData = nil;

if( string ) {
unsigned long ixtext = 0;
unsigned long lentext = 0;
unsigned char ch = 0;
unsigned char inbuf[4], outbuf[4];
short i = 0, ixinbuf = 0;
BOOL flignore = NO;
BOOL flendtext = NO;
NSData *base64Data = nil;
const unsigned char *base64Bytes = nil;

// Convert the string to ASCII data.
base64Data = [string dataUsingEncoding:NSASCIIStringEncoding];
base64Bytes = [base64Data bytes];
mutableData = [NSMutableData dataWithCapacity:[base64Data length]];
lentext = [base64Data length];

}

而且我正在使用另一种名为

的方法
- (NSString *) base64EncodingWithLineLength:(unsigned int) lineLength {
**const unsigned char *bytes = [self bytes];**
NSMutableString *result = [NSMutableString stringWithCapacity:[self length]];

} enter image description here

最佳答案

您可以通过类型转换解决该错误...但不确定数据是否采用相同的格式...

    base64Bytes = (const unsigned char*)[base64Data bytes];

关于iphone - XCode 在 NSData+Base64.m 中标记类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12989112/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com