错误如下图所示
- (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]];
}
答案 0 :(得分:1)
您可以通过类型转换解决该错误...但不确定数据是否在同一格式中。
base64Bytes = (const unsigned char*)[base64Data bytes];