Chuck's Blog

技术、读书与思考

概述

设置Safari默认的User Agent为ipad浏览

defaults write com.apple.Safari CustomUserAgent "'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3'"
阅读全文 »

概述

1.编码 :

NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding (kCFStringEncodingGB_18030_2000);
阅读全文 »

概述

You want to use -[NSTask setStandardOutput:] to attach an NSPipe to the task before launching it. A pipe holds two file handles, the task will write to one end of the pipe, and you’ll read from the other. You can schedule the file handle to read all of the data from the background task and notify you when it’s complete.

详细内容

阅读全文 »

概述

Today is a lucky day, I finally have my first sites on Internet.

详细内容

阅读全文 »

概述

assign就不用说了,因为基本上是为简单数据类型准备的,而不是NS对象们。

详细内容

阅读全文 »

NSString *js1 = [NSStringstringWithFormat:@"alert('a'); ""];
[[selfexWebViewer] stringByEvaluatingJavaScriptFromString: js1];

太简单了哇

阅读全文 »