随笔分类 -  技术文档

在 UIWebView中搜索并高亮度显示文本
摘要:Search and highlight text in UIWebViewSeveral iPhone Apps (like my “iCab Mobile” or “NewsTap” Apps) provide a search feature which allows to search for text in the content that is currently displayed within a UIWebView. The found occurrences of the searched text are highlighted with a yellow backgro 阅读全文

posted @ 2011-06-24 14:27 禚来强 阅读(1178) 评论(0) 推荐(0)

iphone – Getting data from uiwebview textfield
摘要:iphone – Getting data from uiwebview textfield You can use [UIWebView stringByEvaluatingJavascriptFromString:] method and get the values by executing the javascript. Example: If your html is: Following code can get you the value of the text field: NSString* value = [webView stringByEvaluatingJavaSc. 阅读全文

posted @ 2011-06-24 13:50 禚来强 阅读(336) 评论(0) 推荐(0)

如何 让 Chrome (谷歌)浏览器 自动翻译
摘要:我用的chrome浏览器,最初用的时候浏览器默认自动翻译英文,我感觉很麻烦。所以我选择了一律不翻译。但是我当我想翻译的的时候又不知道怎么操作。一直郁闷到现在。今天我突然发现了一个方法可以让你的浏览器自动翻译英文。 1。首先在网页的空白地方右键,选择翻译为中文,然后设置页面就出来了,选择将英文一律翻译成中文,问题解决了。 阅读全文

posted @ 2011-06-24 13:28 禚来强 阅读(11413) 评论(0) 推荐(0)

document.getElementById与getElementByName的区别
摘要:1:id 就像身分证号,是唯一的, name 就像姓名一样可以同名 2:一个元素定义了 id ,引用该元素时直接用 id 属性,而 name 通常用在 form 中,且必须由 document.form.*** 而来,也就是说, name 属性定义的元素在脚本中是 document 对象的子对象。 3:name 用于 form 内元素,提交需要 id 用于 form 外元素好用因为 DOM 能直接取得单一元素 document.getElementById( "id_Number ") 得到的是单个元素 document.getElementsByName( "n 阅读全文

posted @ 2011-06-24 11:52 禚来强 阅读(65399) 评论(0) 推荐(1)

ios UIWebView调用本地html和javascript,并且和ios通讯
摘要:ios和android都提供了有关webview和javascript通讯的功能,这就使开发者根据手机的系统展示适合手机的界面,是界面开发更加简单。 我的原型主要实现通过UIWebView展示本地的html、css、javascript文件,并且和ios互相通讯,用来展示数据。 下面是我实现的一个简单demo,界面效果如下: 点击连接调用ios中的提醒功能: 实现过程: 首先创建一个工程,ipad.web1,编译运行成功。 实现webview的代码: #import @interface ipad_web1ViewController : UIViewController { IBOutlet 阅读全文

posted @ 2011-06-24 09:21 禚来强 阅读(1407) 评论(1) 推荐(0)

iphone 获取UIWebView内Html方法
摘要:获取所有html:NSString *lJs = @"document.documentElement.innerHTML"; 获取网页title:NSString *lJs2 = @"document.title"; UIWebView *lWebView = [self getCurrentWebView]; NSString *lHtml1 = [lWebView stringByEvaluatingJavaScriptFromString:lJs]; NSString *lHtml2 = [lWebView stringByEvaluatingJ 阅读全文

posted @ 2011-06-24 09:20 禚来强 阅读(9492) 评论(0) 推荐(0)

禁止后台运行
摘要:在info.plist文件里看看有没有“Application does not run in background”这一个key,如果没有,点最后一行,然后点这行右边的加号,你会看见最底下又变出来一行,在里面选择“Application does not run in background”,然后把钩打上 阅读全文

posted @ 2011-06-24 09:11 禚来强 阅读(426) 评论(0) 推荐(0)

WebView 删除 cookies
摘要:NSHTTPCookie *cookie; NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSArray *cookieAry = [cookieJar cookiesForURL: [NSURL URLWithString: @"http://api.m.taobao.com"]]; for (cookie in cookieAry) { [cookieJar deleteCookie: cookie]; } 阅读全文

posted @ 2011-06-23 13:50 禚来强 阅读(602) 评论(0) 推荐(0)

iPhone Object-c Base64编码
摘要:下载下面的base64.zip然后皆压缩放到你的项目里面。然后我们自己写一个方法去调用即可,很简单,我自己封装了一个类去做,这样对我来说,库里的函数就比较透明了,当然也不是必须的。在我当前机器上可以使用,如果有问题请联系我。//.h文件,默认即可#import<Foundation/Foundation.h>@interface Utility : NSObject {}+(NSString*)encodeBase64:(NSString*)input;+(NSString*)decodeBase64:(NSString*)input;@end上面是头文件,下面是代码文件,我这样写 阅读全文

posted @ 2011-06-22 20:27 禚来强 阅读(3358) 评论(0) 推荐(0)

如何获取设备的UDID
摘要:UIDevice *device = [UIDevice currentDevice]; return [device uniqueIdentifier]; 阅读全文

posted @ 2011-06-21 11:40 禚来强 阅读(557) 评论(0) 推荐(0)

淘宝错误一览表
摘要:错误码一览表 目录[隐藏] 1 简介 2 平台级错误 3 业务级错误 3.1 业务级父错误 3.2 业务级子错误 4 容器类错误 简介 1,目前开发者调用API可能出现的错误有四类:连接淘宝服务器错误、平台级错误、业务级错误和容器类错误。这四种类型的错误分别代表了开发者访问淘宝服务器、淘宝接入平台、后端业务和容器这几个层次上出现的问题。 2,连接淘宝服务器错误主要是http连接错误或者连接被重置被拒绝等,这类错误是开发者访问淘宝服务器出现的问题,请直接联系服务器管理员或通过网络搜索答案。 平台级错误 1,平台级错误是指错误码小于100的调用错误,这种错误一般是由于用户的请求不符合各种基本校验. 阅读全文

posted @ 2011-06-17 14:37 禚来强 阅读(23437) 评论(0) 推荐(0)

淘宝山寨IOS sdk
摘要:SDK分享——欢迎大家互助分享2/253 慧修店铺 发表于 2011-03-24 16:29 iOS的SDK 基于iOS开发的朋友,可以参考iOS的SDK,感谢北京天籁传音数字技术有限公司的杨子刚为大家分享。 下载地址:http://download.taobaocdn.com/mtop/release/ApiDemo(iphone).zip 使用说明:app_key在NSMutableDictionaryTaobao.m里面修改 咨询帮助:请发邮件联系杨子刚同学,email为yang.zigang@audiocn.com 也欢迎大家能共享其他平台的SDK或者优化现有的SDK,有意者可以在此回 阅读全文

posted @ 2011-06-17 14:05 禚来强 阅读(598) 评论(0) 推荐(0)

自定义键盘
摘要:有一种思路叫寄生... 我相信是懒人推动了世界的发展,既然iphone有了自己的软件盘,我们什么还要自己实现其功能呢。 so,只要寄生在上面就行了。 感谢alan转载的文章给的灵感。 http://www.cocoachina.com/bbs/read.php?tid-3999.html 思路: 1.用静态方法找到应用程序当前view(window)中的UIKeyboard的view 2.在键盘的view上帖上自己的view,(精彩了,这个自己的view就是你自己键盘,任意发挥,什么类型键盘都可以做了) 3.根据需要调整系统键盘的大小以满足你想要的尺寸 4.给自己的键盘view上的button 阅读全文

posted @ 2011-06-16 09:47 禚来强 阅读(678) 评论(2) 推荐(0)

HTTP header location 重定向 URL
摘要:http头信息 头信息的作用很多,最主要的有下面几个: 1、跳转 当浏览器接受到头信息中的 Location: xxxx 后,就会自动跳转到 xxxx 指向的URL地址,这点有点类似用 js 写跳转。但是这个跳转只有浏览器知道,不管体内容里有没有东西,用户都看不到。 例:header("Location: http://www.xker.com/"); 阅读全文

posted @ 2011-06-15 10:48 禚来强 阅读(1956) 评论(0) 推荐(0)

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4. failed with exit code 1
摘要:今天出现这种错误,也许你也出现了,找了半天没有找到错误的根源。 呵呵,其实这个错误,真是太低级了,你一定#import "ClassName.m" 修改为 #import "ClassName.h" 就搞定了。 阅读全文

posted @ 2011-06-14 14:07 禚来强 阅读(2993) 评论(1) 推荐(0)

HTTP头的Expires与Cache-control
摘要:HTTP头的Expires与Cache-control 1.概念 Cache-control用于控制HTTP缓存(在HTTP/1.0中可能部分没实现,仅仅实现了Pragma: no-cache) 数据包中的格式: Cache-Control: cache-directive cache-directive可以为以下: request时用到: | "no-cache" | "no-store" | "max-age" "=" delta-seconds | "max-stale" [ " 阅读全文

posted @ 2011-06-14 10:10 禚来强 阅读(377) 评论(0) 推荐(0)

Delete .svn folders on your Mac 删除 .svn
摘要:Delete .svn folders on your Mac Sometimes you need to get rid of .svn hidden folders on your Mac. In my case it was about resyncing my local working copy with client subversion repository. Everything was broken at both ends. A couple of terminal commands to get rid of unneeded svn tracks: cd /some/o 阅读全文

posted @ 2011-06-13 18:36 禚来强 阅读(691) 评论(0) 推荐(0)

给视图添加阴影
摘要:UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(1, 1, 66.0f, 76.0f)]; imageview.tag=1; [imageview setImage:img]; imageview.layer.shadowColor=[UIColor blackColor].CGColor; imageview.userInteractionEnabled=YES; imageview.layer.shadowOpacity=0.5; imageview.layer.shadowOffset = CG 阅读全文

posted @ 2011-06-13 12:10 禚来强 阅读(1150) 评论(0) 推荐(0)

core plot 使用方法
摘要:- (void)constructScatterPlot{// Create graph from themegraph = [[CPXYGraph alloc] initWithFrame:CGRectZero];CPTheme *theme = [CPTheme themeNamed: @"Dark Gradients"];[graph applyTheme:theme];scatterPlotView.hostedGraph = graph;graph.paddingLeft = 10.0;graph.paddingTop = 10.0;graph.paddingRi 阅读全文

posted @ 2011-06-13 11:23 禚来强 阅读(2714) 评论(1) 推荐(2)

NSDecimalNumber NSNumber 区别 使用方法
摘要:NSDecimalNumber 是NSNumber的子类。 使用 [NSNumber numberWithDouble:]方法来格式我的NSNumber,但是,由于一些值比较大,我想要用科学计数法来表示。 NSDecimalNumber就提供了科学计数法的表示方法。 什么是科学计数法? 将一个数字表示成 (a×10的n次幂的形式),其中1≤a<10,n表示整数,这种记数方法叫科学记数法。 用幂的形式,有时可以方便的表示日常生活中遇到的一些较大的数,如:光的速度大约是300 000 000米/秒;全世界人口数大约是:6 100 000 000 这样的大数,读、写都很不方便,考虑到10的 阅读全文

posted @ 2011-06-13 10:41 禚来强 阅读(1149) 评论(0) 推荐(0)

导航