私のプロジェクト:WIFI、SOCKET 伝送を介して接続されています。画像データを受信すると、エラー メッセージ:<code>ImageIO: <ERROR> JPEGNot a JPEG file: starts with 0xff 0xd9。</code>
-(void)decodeData:(char*)data length:(int)length {
struct TVDATA *tvData=(struct TVDATA *)data;
[jpgData appendBytes:(char*)tvData+8 length:length-8];
if(tvData->m_frag_totle-1==tvData->m_frag_cur) {
image = [[UIImage alloc] initWithData:jpgData];
[self performSelectorOnMainThread:@selector(aa) withObject:nil waitUntilDone:!NO];
jpgData.length=0;
}
-(void)aa {
if(imgView.image!=nil){
[imgView.image release];
}
imgView.image=image;
[scrollView setDisplayImage:image];
if (videoflag==1) {
[self performSelectorOnMainThread:@selector(writeVideo) withObject:nil waitUntilDone:!NO];
}
}