08 2011 档案
NSTimer, NSTask, NSThread and NSRunloop
摘要:Each program runs in at least onethread. You can think of each thread as a separate process of program execution, each running parallel to the others.If you have some kind of user interface, or other code that needs to listen to events (like network ports), you need arun loop. Every NSThread automat 阅读全文
posted @ 2011-08-27 12:02 wwwkhd
编译iPhone下的FFmpeg
摘要:mkdir ./build# configure for armv7 build./configure \--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \--as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \-- 阅读全文
posted @ 2011-08-09 10:01 wwwkhd
release 时去掉nslog的方法&&可变参数宏
摘要:release 时去掉nslog的方法#ifdef __i386__# define NSLog(...) NSLog(__VA_ARGS__)#else# define NSLog(...) {}#endif上例是用C99标准中的可变参数宏来实现的。在C/C++语言中,"…"表示可以接受不定数量的参数,理论上来讲,可以是0或0以上的n个参数。用可变参数宏(variadic macros)传递可变参数表你可能很熟悉在函数中使用可变参数表,如:void printf(const char* format, …);直到最近,可变参数表还是只能应用在真正的函数中,不能使用在宏中。 阅读全文
posted @ 2011-08-01 15:03 wwwkhd