posted @ 2012-08-03 17:30 3k 阅读(320) 评论(0) 推荐(0)
摘要:
1.首先UIWebView背景透明 // set background transparent, also can set it in nib file webView_.backgroundColor = [UIColor clearColor]; webView_.opaque = NO;2.隐藏拖拽webview时上下的两个有阴影效果的subview// remove shadow view when drag web view for (UIView *subView in [webView_ subviews]) { if ([subView isKindOfClass:[UIScr 阅读全文
摘要:
实现NSURLConnectionDelegate 的代理方法:- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];}- (void)connection:(NSURLConnection *). 阅读全文
posted @ 2012-06-26 14:57 3k 阅读(807) 评论(0) 推荐(0)
摘要:
在webView的载入完成委托方法里- (void)webViewDidFinishLoad:(UIWebView *)awebView {NSString *string = [awebView stringByEvaluatingJavaScriptFromString:@"document.getElementById('field_2').value;" ]; NSLog(@"string:%@", string);//这样就得到了field_2控件的value.}当然不必非要在- (void)webViewDidFinishLo 阅读全文
posted @ 2012-06-26 14:47 3k 阅读(317) 评论(0) 推荐(0)
摘要:
本文主要是阐述一下Block中如何的使用外部变量以及block本身的内存管理。先定义一个block变量,作为后续的例子中使用: typedefvoid(^BlockCC)(void); BlockCC_block;1、block中引用外部变量block中可以直接使用外部的变量,比如 intnumber=1; _block=^(){ NSLog(@"number%d",number); };那么实际上,在block生成的时候,是会把number当做是常量变量编码到block当中。可以看到,以下的代码,block中的number值是不会发生变化的: int... 阅读全文
posted @ 2012-05-26 17:26 3k 阅读(164) 评论(0) 推荐(0)
摘要:
If you terminate your app by pressing the home button (in the Simulator or on the device), your User Defaults will get saved.If you terminate your app by pressing "Stop" in Xcode (in the Simulator or on the device), your User Defaultsmightget saved, but there's a good chance they won 阅读全文
posted @ 2012-05-26 17:17 3k 阅读(133) 评论(0) 推荐(0)
摘要:
1、将文件checkout到本地目录svn checkoutpath(path是服务器上的目录) 例如:svn checkout svn://192.168.1.1/pro/domain 简写:svn co2、往版本库中添加新的文件svnaddfile 例如:svnaddtest.php(添加test.php) svnadd*.php(添加当前目录下所有的php文件)3、将改动的文件提交到版本库svn commit-m"LogMessage"[-N][--no-unlock]PATH(如果选择了保持锁,就使用--no-unlock开关) 例如:svn commit -m&q 阅读全文
posted @ 2012-05-17 17:16 3k 阅读(439) 评论(0) 推荐(0)
摘要:
无论你是在玩游戏,还是在看VCD,你都会听到美妙的音乐从计算机中传出来.那么,计算机又是如何处理声音的呢?采集和播放声音 我们都知道,声音是一种波,人的隔膜感受到声波的振动,并通过听觉神经付给大脑,于是我们就听到了声音.声波的振动幅度越大,所听到的声音就越响;而声波振动的频率越高,我们听到的声音就越尖细.一般来说,正常人的耳朵只能分辨频率从20Hz到22KHz之间的声音. 毫无疑问,声音是一种模拟信号,而计算机只能处理数字信息0和1。因此,首先要把模拟的声音信号变成计算机能够识别和处理的数字信号,这个过程称为数字化,也叫“模数转换”。在计算机对数字化后的声音信号处理完后,得到的依然是数字信号。 阅读全文
posted @ 2012-05-16 13:50 3k 阅读(3708) 评论(0) 推荐(0)
摘要:
1. UIGraphicsBeginImageContextWithOptions(pageView.page.bounds.size, YES, zoomScale);[pageView.page.layer renderInContext:UIGraphicsGetCurrentContext()];UIImage *uiImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();2.- (UIImage *) glToUIImage {DWScrollView *pageView =... 阅读全文
posted @ 2012-05-11 11:27 3k 阅读(276) 评论(0) 推荐(0)
摘要:
JDK 版本引起的问题以下命令在终端执行sudo ln -s CurrentJDK /System/Library/Frameworks/JavaVM.framework/Versions/1.5sudo ln -s CurrentJDK /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0 阅读全文
posted @ 2012-04-06 21:45 3k 阅读(495) 评论(0) 推荐(0)
摘要:
ABAddressBookRef addressBook = ABAddressBookCreate();CFArrayRef results = ABAddressBookCopyArrayOfAllPeople(addressBook);for(int i = 0; i < CFArrayGetCount(results); i++){ABRecordRef person = CFArrayGetValueAtIndex(results, i);//读取firstnameNSString *personName = (NSString*)ABRecordCopyValue(perso 阅读全文
posted @ 2012-03-16 15:14 3k 阅读(312) 评论(0) 推荐(0)
浙公网安备 33010602011771号