摘要:
在多线程操作中,有一个著名的错误,叫做“Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread”,一旦出现这个错误,程序会立即crashed。
这是由于,apple不允许程序员在主线程以外的线程中对ui进行操作(Bug?)
而笔者在一次http异步操作中也出现过这个错误。当时使用了NSOperation进行了http异步请求,然后使用kvo模式注 阅读全文
2011年6月9日
摘要:
由于iPhone控件的极度匮乏和自定义组件在重用上的限制,在过去的项目中我们积累了大量的“纯代码”组件——因为IB本身的限制,我们无法把这些组件封装为IB组件库(本来我们想通过分发xib文件的方式重用这些组件,但最终发现这根本不可能,苹果的Plug-in编程不支持iPhone)。 最终我们想到了静态库。虽然这仍然还是一种比较原始的复用方式,但起码我们可以隐藏组件的源代码。 下面, 我们使用iPhone静态库把自定义组件CheckButton 进行进一步的封装。(组件的实现参考前一篇博文《自定义控件复选框和单选框的实现》) 一、实现静态库 新建工程, 选择 Library 下的 “ Cocoa 阅读全文
摘要:
No Interfaces Available In Wireshark Mac OS X No Interfaces Available In Wireshark Mac OS X Many new Wireshark users on Mac OS X run into an issue where no interfaces show up when trying to begin packet capture. If you attempt to manually input an interface (such as en0) this error will occur: The . 阅读全文
摘要:
(转)multipart form-data boundary 说明收藏原文链接:http://yefeng.javaeye.com/blog/315847含义 ENCTYPE="multipart/form-data" 说明:通过 http 协议上传文件 rfc1867协议概述,jsp 应用举例,客户端发送内容构造1、概述在最初的 http 协议中,没有上传文件方面的功能。 rfc1867 (http://www.ietf.org/rfc/rfc1867.txt) 为 http 协议添加了这个功能。客户端的浏览器,如 Microsoft IE, Mozila, Opera 阅读全文
摘要:
地址:http://www.w3.org/Addressing/rfc1808.txtRFC 1808 Relative Uniform Resource Locators June 1995格式: :///;?#each of which, except , may be absent from a particular URL. These components are defined as follows (a complete BNF is provided in Section 2.2): scheme ":" ::= scheme name, as per Se 阅读全文
2011年6月8日
摘要:
iOS 4.3 to iOS 5.0 API Differences Added frameworks: Accounts CoreBluetooth CoreImage GLKit GSS NewsstandKit Twitter Accelerate Alpha.h Added #def VIMAGE_ALPHA_H Added vImageAlphaBlend_ARGB8888() Added vImageAlphaBlend_ARGBFFFF() Added vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGB8888() Add. 阅读全文
摘要:
NSDateFormatter setDateFormat 自定義日期/時間格式 參考: http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns 阅读全文
2011年6月7日
摘要:
http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/ 阅读全文
摘要:
为了代码保密或者代码重用等等原因需要把现有的代码打包放入静态库中,这也是静态库的好处,所以今天一天都在研究如何用xcode 4创建静态库,也是为了我们的项目需要。QQ发布的微博SDK会报错,也是因为没有把静态库打包为unniver static libraries的原因,至于是什么是unniver static libraries,大家可以google一下。(http://blog.boreal-kiss.net/2011/03/15/how-to-create-universal-static-libraries-on-xcode-4/)下面是创建静态库的方法1.xcode-create p 阅读全文
摘要:
How to create universal static libraries on Xcode 4: the traditional way by borealkiss [Note on 09.04.2011: This article will not be helpful unless you really need universal static libraries for distribution purposes etc. Instead, using workspace is a better way for daily development.] INTRODUCTION. 阅读全文