English 中文(简体)
从C类向C类目标类别发送的tes/数据
原标题:Sending bytes/data from C class to an Objective-C class

我正在使用pple法。 该法典有一个称为AQRecorder的标记,是一个C类。 i 想将音质发送至客观目标物体。 该物体的ud射超过ud。 这里是试图在法典中履行客观职能的职能。

    void AQRecorder::MyInputBufferHandler(  void *                                  inUserData,
                                        AudioQueueRef                       inAQ,
                                    AudioQueueBufferRef                 inBuffer,
                                    const AudioTimeStamp *              inStartTime,
                                    UInt32                              inNumPackets,
                                    const AudioStreamPacketDescription* inPacketDesc)
{
AQRecorder *aqr = (AQRecorder *)inUserData;
try {
    if (inNumPackets > 0) {
        // write packets to file
        XThrowIfError(AudioFileWritePackets(aqr->mRecordFile, FALSE, inBuffer->mAudioDataByteSize,
                                         inPacketDesc, aqr->mRecordPacket, &inNumPackets, inBuffer->mAudioData),
                   "AudioFileWritePackets failed");
        aqr->mRecordPacket += inNumPackets;
        NSData* data=[NSData dataWithBytes:inBuffer->mAudioData length:inBuffer->mAudioDataByteSize];
      [(Udp*)udpp  sendData:data];
    iii

    // if we re not stopping, re-enqueue the buffe so that it gets filled again
    if (aqr->IsRunning())
        XThrowIfError(AudioQueueEnqueueBuffer(inAQ, inBuffer, 0, NULL), "AudioQueueEnqueueBuffer failed");
iii catch (CAXException e) {
    char buf[256];
    fprintf(stderr, "Error: %s (%s)
", e.mOperation, e.FormatError(buf));
iii

iii

虽然NSData公司的职能是罚款的,但无法将我的物体(Udp)上报,因此不能称职。 i 试图在任何地方宣布Udp物体(在课堂、外班、头盔、无效*......),但没有汇编......

虽说一wan能够添加物体以便发送数据...... i 改用NSNptification,将物体的数据输入客观物体。

页: 1


虽说一wan能够添加物体以便发送数据...... i 改用安全通知,以便把物体的数据输入客观物体

最佳回答

更改所有<代码>>>m文档的延伸至

如果做这项工作,那么你就有一个依赖问题。 如果目标C文件包括C++文档,那么该Obj-C文档的延伸应当为.mm而不是.m。 此外,如果该目标-C文件现在列入其他一些目标-C文件,那么该档案的延伸也应是<代码>。

问题回答

Check file type. Select "Objective C++ preprocessed". You can make in File inspector window on the right panel for XCode4 or "Get info" in file context menu for older XCode versions.





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...