我在我的项目中成功使用ARC.但是,我遇到了一些文件(例如,在单元测试和模拟对象中),其中ARC的规则现在更加脆弱.我记得听说有一种方法可以在每个文件的基础上禁用ARC,但我无法找到这个选项.
这可能吗?如何基于每个文件禁用ARC?
xcode objective-c automatic-ref-counting manual-retain-release
我有一个播放声音的按钮,它似乎在模拟器上工作得很好,但我收到这条消息:
Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-01 02:13:02.605 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-01 02:13:02.657 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-01 02:13:02.671 Halloween FX[33484:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in …
有人在iOS上播放过ogg流吗?如果不编写自己的解码器,我可以使用什么?
我正在使用Apple的AVPlayer播放流.
这个问题已被问到这个问题的一部分: iOS在线广播流媒体问题,但尚未得到解答.
我正在开发一个Xcode应用程序,需要ogg和vorbis框架来播放ogg文件.我已经搜索了有关此的一些信息,但我没有达到任何意义,我不知道如何使这个框架工作.我已经下载了这些库并将它们添加到我的项目中,但即使文件已经存在,我仍然没有得到它编译它抱怨丢失文件.
谁能指点我一本关于如何实现这个目标的好手册?
任何帮助赞赏.
我试图在OSX上播放声音,来自缓冲区(例如:等效的Windows"PlaySound"功能).
我已经整理了一些C++代码来播放AudioQueue的音频(因为我的理解是这是在OSX上播放音频的最简单方法).
但是,从未生成声音,并且从不调用音频回调函数.
有人知道我做错了什么,或者有没有人有一个简单的C/C++例子来说明如何在OSX上播放声音?
#include
#include
#define BUFFER_COUNT 3
static struct AQPlayerState {
AudioStreamBasicDescription desc;
AudioQueueRef queue;
AudioQueueBufferRef buffers[BUFFER_COUNT];
unsigned buffer_size;
} state;
static void audio_callback (void *aux, AudioQueueRef aq, AudioQueueBufferRef bufout)
{
printf("I never get called!\n");
#define nsamples 4096
short data[nsamples];
for (int i=0;imAudioDataByteSize = nsamples * sizeof(short) * 1;
assert(bufout->mAudioDataByteSize mAudioData, data, bufout->mAudioDataByteSize);
AudioQueueEnqueueBuffer(state.queue, bufout, 0, NULL);
}
void audio_init()
{
int i;
bzero(&state, sizeof(state));
state.desc.mFormatID = kAudioFormatLinearPCM;
state.desc.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
state.desc.mSampleRate = 44100; …
Run Code Online (Sandbox Code Playgroud) 请原谅我,我在iOS上非常新 - 并且总体上以这种规模进行编程.
我一直在挖掘iOS文档,我知道有一些像ExtAudiofile这样的函数用于解码MP3/AAC文件,但有没有可以对已经在内存中的Mp3/aac数据进行操作?
我可能不得不从另一个文件中提取媒体数据(逐字节; iOS确实允许吗?),所以我不能只给它一个URL.
编辑:mp3数据将采用非标准文件格式,Apple提供的功能应该无法读取它们.我听说iOS有一个可以在一个音频流上运行的硬件解码器,如果有多个流,操作系统将回退到软件解码.
我宁愿使用Apple提供的功能,然后将MP3解码器集成到应用程序中.