【发布时间】:2015-08-22 06:29:05
【问题描述】:
当我将构建设置为发布配置方案时,我的应用出现问题。该应用程序使用的其中一种音效在调试配置中可以正常播放,但在发布配置中则不行。在这种“模式”下,我如何从应用程序中获得反馈?在调试配置中,您显然可以使用NSLog 或设置断点。有什么想法吗?
编辑
总体问题是在调试配置中,plist 是在下面列出的两种方法中读取的。在发布配置中,plist 只能通过以下方法之一读取。
这是加载文件的代码。只有前几行很重要。 NSString *audioInfoPList 对于 initSfx: 是 nil,但对于 `initMusic 不是:
-(void) initMusic {
_musicDict = [NSMutableDictionary dictionary];
NSString *audioInfoPList = [[NSBundle mainBundle] pathForResource: @"AudioInfo" ofType: @"plist"];
NSDictionary *audioInfoData = [NSDictionary dictionaryWithContentsOfFile:audioInfoPList];
//more processing here
...
}
-(void) initSfx {
_sfxDict = [NSMutableDictionary dictionary];
NSString *audioInfoPList = [[NSBundle mainBundle] pathForResource: @"AudioInfo" ofType: @"plist"];
NSDictionary *audioInfoData = [NSDictionary dictionaryWithContentsOfFile:audioInfoPList];
//more processing here
...
}
这里是AudioInfo.plist:
【问题讨论】:
标签: objective-c xcode6 release