Somewhere out there on the internet, there’s a “showdown” between @synchronized, NSLock, pthread mutexes, and OSSpinLock. It aims to measure their performance relative to each other, but uses sloppy code to perform the measuring. As a result, while the performance ordering is correct (@synchronized is the slowest, OSSpinLock is the fastest), the relative cost is severely misrepresented. Herein I attempt to rectify that benchmark.
关于 NSBundle 路径遇到的一点问题
发表于
|
分类于
ios 基础
[1] 想要解决的问题
记忆蝰蛇音效最后加载的 .irs 或者 .wav 路径。
[2] 解决过程
[2.1] 能够想到的最简单的解决办法就是直接持久化保存即可。可以写到 plist 文件或者使用NSUserDefaults保存。最后选择了后者。.irs 文件放在工程 [NSBundle mainBundle]下的 irs 文件夹里面。