1

错误如下图所示 在此处输入图像描述

- (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]];

} 在此处输入图像描述

4

1 回答 1

1

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

    base64Bytes = (const unsigned char*)[base64Data bytes];
于 2012-10-20T14:09:20.727 回答