3
Objective-C++の短いintをObjective-C配列に保存し、後でObjective-C++に変換するにはどうすればよいですか?私は成功なしで次のように試みました。どんな助けも素晴らしいだろう!Objective-C++からObjective-Cへの値の保存/取得
short int *tmpbuffer = (short int*)malloc(sizeof(short int)*length*inData);
int count = 0;
for (count = 0; count < length*inData; count++)
{
tmpbuffer[count] = (short int) (inbuffer[count] * 0x7fff);
}
size = fwrite(tmpbuffer, 1, sizeof(short int)*length*inData,fp);
[fwriteSections addObject:[NSNumber numberWithShort:tmpbuffer]];
[fwriteSections addObject:[NSNumber numberWithShort:sizeof(short int)*length*inchannels]];
[fwriteRows addObject:fwriteSections];