我正在尝试在 webview 中加载 base64 编码数据。以下是我正在使用的代码
NSDictionary *fileFormatDic=[[NSDictionary alloc]initWithObjectsAndKeys:@"text/html",@"html",@"mage/jpeg",@"jpe",@"image/jpeg",@"jpeg",@"image/jpeg",@"jpg",@"application/pdf",@"pdf",@"application/vnd.ms-powerpoint",@"pdf",@"text/plain",@"txt",@"application/vnd.ms-excel",@"xls",@"application/msword",@"doc",nil];
NSData *fileData= [dbServiceMgr getDocumentDataForTheTaskId:[_fileDetailsDic objectForKey:@"taskId"] andFileId:[_fileDetailsDic objectForKey:@"fileId"]];
NSLog(@"filedata length---%d",fileData.length);
NSString *mimeType=[fileFormatDic objectForKey:[_fileDetailsDic objectForKey:@"fileFormat"]];
[_webView loadData:fileData MIMEType:mimeType textEncodingName:@"Base64" baseURL:nil];
但是我的网页视图中没有显示任何内容。有人可以告诉我,出了什么问题。提前致谢