2012-07-31 57 views
-1

我的应用程序在第一次启动时会崩溃,但是当我再次启动它时。该应用程序很好。应用程序崩溃 - 无法弄清楚为什么

当我按下按钮时,它会崩溃,按钮播放声音并允许用户更改歌曲播放的音高和BPM。

下面是从日志崩溃报告

This GDB was configured as "x86_64-apple-darwin".Attaching to process 1842. 
2012-07-31 19:40:33.437 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:33.447 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:33.477 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:33.483 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:33.493 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:33.498 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:33.508 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:33.515 DubstepDJ[1842:16a03] 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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-07-31 19:40:42.449 DubstepDJ[1842:16a03] Starting 

这是它崩溃

- (OSStatus) readFloatsConsecutive:(SInt64)numFrames intoArray:(float**)audio 
{ 
    OSStatus err = noErr; 

    if (!mExtAFRef) return -1; 

    int kSegmentSize = (int)(numFrames * mExtAFNumChannels * mExtAFRateRatio + .5); 
    if (mExtAFRateRatio < 1.) kSegmentSize = (int)(numFrames * mExtAFNumChannels/
     mExtAFRateRatio + .5); 

    AudioBufferList bufList; 
    UInt32 numPackets = numFrames; // Frames to read 
    UInt32 samples = numPackets * mExtAFNumChannels; 
    UInt32 loadedPackets = numPackets; 

    short *data = (short*)malloc(kSegmentSize*sizeof(short)); 
    if (!data) { 
     NSLog(@"data is nil"); 
     goto error; 
    } 

    bufList.mNumberBuffers = 1; 
    bufList.mBuffers[0].mNumberChannels = mExtAFNumChannels; 
    bufList.mBuffers[0].mData = data; // data is a pointer (short*) to our sample buffer 
    bufList.mBuffers[0].mDataByteSize = samples * sizeof(short); 

    // Crash occurs on this line: 
    **err = ExtAudioFileRead(mExtAFRef, &loadedPackets, &bufList);** 
    if (err) goto error; 

    if (audio) { 
     for (long c = 0; c < mExtAFNumChannels; c++) { 
      if (!audio[c]) continue; 
      for (long v = 0; v < numFrames; v++) { 
       if (v < loadedPackets) audio[c][v] = (float)data[v*mExtAFNumChannels+c]/32768.f; 
       else audio[c][v] = 0.f; 
      } 
     } 
    } 

error: 
    free(data); 
    if (err != noErr) return err; 
    if (loadedPackets < numFrames) mExtAFReachedEOF = YES; 
    return loadedPackets; 
} 

代码我做就行了Xcode中说,“部分大胆exc_bad_access'

谢谢

+2

标题在您的问题的标题不是必需的。见http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles – 2012-07-31 18:50:02

+0

我再次编辑它,因为以前的编辑似乎已经损坏了代码块。 – Wug 2012-07-31 18:52:16

+0

对不起,感谢您的纠正。 – 2012-07-31 19:00:30

回答

0

您尝试使用的框架有问题。在我看到它是内置框架的情况下,我认为您的xCode存在问题。尝试重新安装它。

相关问题