以前对NSObject的isa属性也知道点,但是了解不深,今天看了这篇博文,感觉很好,总结一下: http://chun.tips/blog/2014/11/05/bao-gen-wen-di-objective%5Bnil%5Dc-runtime-(2)%5Bnil%5D-object-and-class-and-meta-class/ 先把里面最重要的图贴上: 我们在看看几个重要的定义: /// An opaque type that represents an Objective-C cl…
简洁既是美,程序员应尽量尝试编写简洁的表达式,争取用简单的代码来实现更多的功能,当然,这也要看情况了(有时候也得考虑程序运行的时间嘛). 在阅读C++Prime Plus到while语句时有一个讲一个数组内容复制到另一个数组的例子: //arr1 is an array if ints int *source=arr1; size_t sz=sizeof(arr1)/sizeof(*arr1); //number of elements int *dest=new int[sz]; while(…