rosylxf

驾驭命运的舵是奋斗。不抱有一丝幻想,不放弃一点机会,不停止一日努力!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年7月18日

摘要: 原文地址:http://numbergrinder.com/node/29Objective-C设计模式:Singleton Pattern当迁移到一种新的编程语言时,需要面临的问题之一就是怎样设计对应于该语言的设计模式。大部分情况语言为设计模式提供了易于实现的内建支持,或者干脆拥有直接实现了这种设计模式。举 例来说,在Python中,实现Command Dispatch模式和Singleton模式几乎时完全不必要的,你只需要在创建的模块(module)顶部插入"""This module implements the singleton pattern" 阅读全文

posted @ 2012-07-18 08:38 rosylxf 阅读(3349) 评论(0) 推荐(1)

2012年7月12日

摘要: iphone程序中实现截屏的一种方法在iphone程序中实现截屏的一种方法://导入头文件#import QuartzCore/QuartzCore.h//将整个self.view大小的图层形式创建一张图片imageUIGraphicsBeginImageContext(self.view.bounds.size);[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];UIImage*image=UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageC 阅读全文

posted @ 2012-07-12 19:36 rosylxf 阅读(4077) 评论(0) 推荐(0)

2012年7月10日

摘要: SDWebImage托管在github上。https://github.com/rs/SDWebImage这个类库提供一个UIImageView类别以支持加载来自网络的远程图片。具有缓存管理、异步下载、同一个URL下载次数控制和优化等特征。使用示范的代码:UITableView使用UIImageView+WebCache类(基本应用,UIImageView的一个category)前提#import导入UIImageView+WebCache.h文件,然后在tableview的cellForRowAtIndexPath:方法下: 1 - (UITableViewCell *)tableView: 阅读全文

posted @ 2012-07-10 16:54 rosylxf 阅读(1916) 评论(0) 推荐(0)

2012年7月5日

该文被密码保护。 阅读全文

posted @ 2012-07-05 16:16 rosylxf 阅读(1) 评论(0) 推荐(0)

2012年7月3日

摘要: 到现在为止,我的黑苹果基本也算完美乐,显卡,声卡,有线和无线网卡驱动等都已经装好,有线网卡是最后一个装上,也是浪费我时间最多的一个,有线网卡型号是:Atheros AR8151 PCI-E Gigabit Ethernet Controller (NDIS 6.20)黑苹果驱动见附件,解压后为AtherosL1cEthernet.kext,放在Extensions下,修复磁盘权限,ok。 阅读全文

posted @ 2012-07-03 23:47 rosylxf 阅读(815) 评论(0) 推荐(0)

摘要: 1,CGRect rect=[[UIScreenmainScreen] bounds];NSLog(@"%@", NSStringFromCGRect(rect));CGRect rect=[[UIScreenmainScreen]applicationFrame];NSLog(@"%@", NSStringFromCGRect(rect));从结构体转化为字符串NSStringFromCGRect:上面几行代码分别打印出:2012-07-03 09:39:34.848 UIWindowDemo[611:f803] {{0, 0}, {320, 480} 阅读全文

posted @ 2012-07-03 09:43 rosylxf 阅读(137) 评论(0) 推荐(0)

2012年7月2日

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2012-07-02 20:00 rosylxf 阅读(8) 评论(0) 推荐(0)

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2012-07-02 10:30 rosylxf 阅读(11) 评论(0) 推荐(0)

2012年7月1日

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2012-07-01 23:11 rosylxf 阅读(7) 评论(0) 推荐(0)

摘要: 1 //字符串的连接 2 #import <Foundation/Foundation.h> 3 4 int main (int argc, const char * argv[]) { 5 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 6 7 NSString* str1 = @"Hello"; 8 NSString* str2 = @" World"; 9 //str1和str2都没有变,方法返回一个新的字符串10 NSString* str3 = [str1 . 阅读全文

posted @ 2012-07-01 22:51 rosylxf 阅读(412) 评论(0) 推荐(0)