一幢并不奢华的公寓,两间普普通通的套房,却住着7个不同背景,不同身份,不同梦想的青年男女。无一例外,他们都是有故事的人,就在这栋爱情公寓里,每天都发生这看似平常却又乐趣十足的故事。时而搞笑、时而离奇、时而浪漫、时而感动。他们在一起,用嬉笑怒骂传达新一代年轻人的生活状态和价值观念。他们在一起,用连珠妙语擦出令人捧腹不已的精彩笑料和智慧火花。
作者: CouldHll
《武林外传》
《虎之卷》
五十川芳仁是乐高界享誉盛名的大师,他为了普及乐高工程教育,撰写了一部名为“虎子卷”的电子书,其中以图解得形式介绍了许多搭建技巧,这部书在他的网站上可以免费下载到。
http://www.isogawastudio.co.jp/legostudio/toranomaki/en/index.html
NSDictionary读plist文件顺序问题
问题描述:
这些天在做AD,NSDictionar读取出来的顺序不是plist文件中的顺序。
问题分析:
试了各种库和方法,无效,网上搜了一些不算解决办法的方法 。
问题解决:
(1) Keep an array of keys along with the dictionary. Then loop through the array and use the keys to get the values. (You'll have to add your own checks to keep the same key from appearing in the array twice.)
1,简单说来就是,把nsdictionary的所有key组成的nsarray按自己的要求排序,然后根据这个key组成的array来获取对应的value的array。key的array不要扔掉,每次要按顺序获取值的时候都需要它。
(2)You could keep an array of custom objects, one custom object for each pair (give the object .key and .value properites) . That's a very object-oriented way, but you lose the ability to easily find the value for a key (you have to loop through the array.)
2,不直接用nsdictionary,而是用一个nsarray,里面每个object都是一个只有一对key-value的nsdictionary。这个方法的缺点是,找某个value或者key会变得很麻烦,需要遍历。
(3)You could keep two arrays of strings, one for keys and one for values.
to find a value for a key, you just use
keyIndex = [myKeys indexOfObject: keyIWant];
keyValue = [myValues objectAtIndex: keyIndex];
3,不用nsdictionary,而是用两个对应的nsarray。相互调用,分别做key和value。
《前度》
《超级大玩家》
《80’后》
《初恋这件小事》
《社交网络》
PV3D中removeChild内存泄露问题
今天cailven用pv3d做Parkroyal Mt demo的时候一直很卡,经过他反复测试,发现是因为里面反复使用了pv3d内建的removeChild()方法。一开始认为是贴图无法被清空造成的,后来他改成了线框贴图,依然很卡。
他的代码是这样的。
因为pv3d的内建removeChild有bug不完善,所以他跳过了这个步骤,直接使用了代码: