Fork me on GitHub

2012年4月14日

摘要: 转自:http://blog.csdn.net/w59879213/article/details/7162769开发心得.首先是获取网络中的图片, 将图片从网络中以NSData的形式读取到本地的代码很简单, 只有两句话就可以了.NSString*url=@"http://www.163.com/a.jpg";NSData*imageData=[[NSDataalloc]initWithContentsOfURL:[NSURLURLWithString:url]];其次是将图片保存到sqlite中, 在查询中绑定BLOB类型即可sqlite3_bind_blob(stmt, 阅读全文
posted @ 2012-04-14 09:46 pengyingh 阅读(2678) 评论(0) 推荐(0)
摘要: BlockApple 在C, Objective-C, C++加上Block這個延申用法。目前只有Mac 10.6 和iOS 4有支援。Block是由一堆可執行的程式組成,也可以稱做沒有名字的Function (Anonymous function)。如果是Mac 10.6 或 iOS 4.0 之前的平台可以利用 http://code.google.com/p/plblocks/ 這個project得以支援Block語法。Apple有一個叫做GCD(Grand Central Dispach)的新功能,用在同步處理(concurrency)的環境下有更好的效率。Block語法產生的動機就是來 阅读全文
posted @ 2012-04-14 09:41 pengyingh 阅读(190) 评论(0) 推荐(0)
摘要: http://blog.csdn.net/workhardupc100/article/details/7443580UIWebView*webView = [[[UIWebViewalloc]initWithFrame:CGRectMake(0,0,320,480)]autorelease];NSString*htmlPath = [[[NSBundlemainBundle]bundlePath]stringByAppendingPathComponent:@"Quartz2D.html"];htmlPath = [htmlPathstringByAddingPercen 阅读全文
posted @ 2012-04-14 09:38 pengyingh 阅读(305) 评论(0) 推荐(0)
摘要: 转自:http://haoxiang.org/page/5/UIViewController的loadView用UIViewController有一段时间了,才发现以前对loadView的理解完全不到位。假如我们用Xcode新建一个View-based Application,在ViewController.m中加上- (void) loadView {NSLog(@"loadView Called");}再增加viewDidLoad,按照一般的情况,我们会有这样的Code- (void) viewDidLoad {[super viewDidLoad];UIButton 阅读全文
posted @ 2012-04-14 09:36 pengyingh 阅读(11948) 评论(0) 推荐(0)

导航