摘要: 相信很多朋友跟我一样,有一天升级了XCode 4.5 后发现原来好好的PHONEGAP项目在编译或打包时会报出以下错误:Command/usr/sbin/chown failed withexit code 1 这个问题的起因是PHONAGAP的源码编译时Architecture 和 相关项中的'arm6'支持所导致的,在CordvaLib中的Build settings 中查找 “ARM6” 统统去掉,便可顺利通过编译了。 阅读全文
posted @ 2012-09-21 17:00 EKO.KL 阅读(307) 评论(0) 推荐(0)
摘要: 1 //利用Prototype属性为String对象添加一个方法 2 3 String.prototype.format = function() 4 { 5 var args = arguments; 6 return this.replace(/\{(\d+)\}/g, 7 function(m,i){ 8 return args[i]; 9 });10 }11 12 13 14 //利用js对象的特性,动态添加对象属性并赋于方法体,实现类同于C#、JAVA等语言的String.f... 阅读全文
posted @ 2012-09-21 05:51 EKO.KL 阅读(325) 评论(0) 推荐(0)
摘要: 1 Array.prototype.removeItem = function (target) { 2 var elIndex; 3 for(elIndex in this){ 4 if(this[elIndex] == target) break; 5 } 6 if (!this.hasOwnProperty(elIndex)) return; 7 if (isNaN(parseInt(elIndex)) || !(this instanceof Array)) delete this[elIndex]; 8 else this.splice(elIndex, 1); 9 };10 11. 阅读全文
posted @ 2012-09-21 04:12 EKO.KL 阅读(304) 评论(0) 推荐(0)