2015.09.24
openGL相关
使用GLKView可以大大简化opengl开发,但是灵活性降低,使用心得(不知道正确与否):
1、使用GLKView,其ViewController必须是GLKViewController或其子类,而且GLKViewController的.view必须 = GLKView,否则无法动态渲染
2、GLKViewController是继承自UIViewController的,所以控件正常添加。
3、抗锯齿,对GLKViewController
view.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888;
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
view.drawableStencilFormat = GLKViewDrawableStencilFormat8;
// Enable multisampling
view.drawableMultisample = GLKViewDrawableMultisample4X;
4、自创建类,实现渲染,具体见程序
AVAudioPlayer
使用AVAudioPlayer实现音频播放
NSError *error;
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFStringRef([[NSBundle mainBundle] pathForResource:@"ua4" ofType:@"caf"]), kCFURLPOSIXPathStyle, false);
mAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:(__bridge NSURL*)url error:&error];
公放而不是听筒
UInt32 doChangeDefaultRoute = 1;
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker,sizeof(doChangeDefaultRoute), &doChangeDefaultRoute);
在openGL下播放声音会使帧数下降,由原来60降到30左右
http://stackoverflow.com/questions/20844186/avaudioplayer-drops-frame-rate
解决办法是在非主线程里调用播放。
2015.10.09
build计数
http://stackoverflow.com/questions/21114376/how-to-auto-increment-the-build-number-in-xcode-5
每次build,build都会+1
AVAudioPlayer 播放格式
可以播放m4a,使用格式工厂转换格式到m4a
2015.10.19
对指针越界写入会造成程序莫名其妙的崩溃,所以一定要细心..
2015.10.19
GCD线程同步
http://blog.youkuaiyun.com/q199109106q/article/details/8566300
dispatch queue按先进先出的顺序,串行或并发地执行任务
1> serial dispatch queue一次只能执行一个任务, 当前任务完成才开始出列并启动下一个任务
2> concurrent dispatch queue则尽可能多地启动任务并发执行
串行queue确保任务按可预测的顺序执行,而且只要你异步地提交任务到串行queue,就永远不会产生死锁。
利用dispatch_queue_create函数创建串行queue
- dispatch_queue_t queue;
- queue = dispatch_queue_create("cn.itcast.queue", NULL);
2015.11.10
category
http://blog.youkuaiyun.com/yhawaii/article/details/6992094
2015.11.12
iOS9 http访问
http://segmentfault.com/a/1190000002933776