Fork me on GitHub
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 125 下一页

2012年4月14日

摘要: 转自: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)

2012年4月13日

摘要: http://blog.sina.com.cn/s/blog_45e2b66c01011enz.html 互联网 App 中经常会用到 html 颜色值转换 UIColor,比如:#FF9900、0XFF9900 等颜色字符串,以下方法可以将这些字符串转换为 UIColor 对象。+ (UIColor *) colorWithHexString: (NSString *) stringToConvert { NSString *cString = [[stringToConvert stringByTrimmingCharactersInSet:[NSCharacterSet... 阅读全文
posted @ 2012-04-13 18:19 pengyingh 阅读(240) 评论(0) 推荐(0)
摘要: http://www.lexun.cn/thread-6030948-1-1.htmlNSURL *url = [NSURL URLWithString:urlStr];NSData *data = [NSData dataWithContentsOfURL:url];NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);NSString *retStr = [[NSString alloc] initWithData:data encoding:enc] 阅读全文
posted @ 2012-04-13 16:50 pengyingh 阅读(2367) 评论(0) 推荐(0)
摘要: 本博客网址:http://blog.csdn.net/reille/,转载本博客原创文章请注明出处。本文内容概要: 代码中特殊的注释技术——TODO、FIXME和XXX的用处。前言:今天在阅读Qt Creator的源代码时,发现一些注释中有FIXME英文单词,用英文词典居然查不到其意义!实际上,在阅读一些开源代码时,我们常会碰到诸如:TODO、FIXME和XXX的单词,它们是有其特殊含义的。、TODO: + 说明:如果代码中有该标识,说明在标识处有功能代码待编写,待实现的功能在说明中会简略说明。FIXME: + 说明:如果代码中有该标识,说明标识处代码需要修正,甚至代码是错误的,不能工作,需要 阅读全文
posted @ 2012-04-13 15:01 pengyingh 阅读(57441) 评论(0) 推荐(9)
摘要: http://wenku.baidu.com/view/58b6cf0ebb68a98271fefa4a.html别笑我啊,有的时候真容易把这些搞混淆了,自己经历过,知道那种模棱两可的感觉,所以写出来总结一下一步一步的说:先说沙盒:使用NSHomeDirectory()方法获得的路径的最后一部分代表你的沙盒。例如:home /UsersLibrary/Application Support/iPhone Simulator/4.2/Applications/E25B7E27-D34F-4091-877C-234C3658C5D1E25B7E27-D34F-4091-877C-234C3658C 阅读全文
posted @ 2012-04-13 09:42 pengyingh 阅读(491) 评论(0) 推荐(0)
摘要: 1.UIImageView不支持内部图片平铺(tile)2.资源中的图片要用小写的,模拟器中可能不区分大小写,但在真机中区分.[UIImage imageNamed:@""]; 在设备中区分大小写3.UIView没有背景图属性,有背景色属性.设置背景图可以用addSubView(backgroundImage);,推荐的是设置背景色。4.[UIImage imageNamed:@""];//它是有缓存特性的This method looks in the system caches for an image object with the specifi 阅读全文
posted @ 2012-04-13 09:34 pengyingh 阅读(5707) 评论(0) 推荐(0)
摘要: http://blog.sina.com.cn/s/blog_45e2b66c01011bjn.html第一种方法://首先声明app UIApplication * app= [UIApplication sharedApplication]; //接下来四行是新的功能,能检查设备是否支持后台,老系统和一代的backgroundSupported = NO;支持的自然就是YES啦 UIDevice* device = [UIDevice currentDevice]; BOOL backgroundSupported = NO; if ([device... 阅读全文
posted @ 2012-04-13 09:31 pengyingh 阅读(892) 评论(0) 推荐(0)
摘要: CGContextSaveGState与CGContextRestoreGState的作用使用Quartz时涉及到一个图形上下文,其中图形上下文中包含一个保存过的图形状态堆栈。在Quartz创建图形上下文时,该堆栈是空的。CGContextSaveGState函数的作用是将当前图形状态推入堆栈。之后,您对图形状态所做的修改会影响随后的描画操作,但不影响存储在堆栈中的拷贝。在修改完成后,您可以通过CGContextRestoreGState函数把堆栈顶部的状态弹出,返回到之前的图形状态。这种推入和弹出的方式是回到之前图形状态的快速方法,避免逐个撤消所有的状态修改;这也是将某些状态(比如裁剪路径) 阅读全文
posted @ 2012-04-13 09:22 pengyingh 阅读(751) 评论(0) 推荐(0)

2012年4月11日

摘要: 在info.plist中增加一项:<key>UIInterfaceOrientation</key><string>UIInterfaceOrientationLandscapeRight</string>再加一项 initial interface orientationLandscape(right)View- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {// Return YES for supporte 阅读全文
posted @ 2012-04-11 14:29 pengyingh 阅读(247) 评论(0) 推荐(0)

2012年4月10日

摘要: 特殊动作:CallFuncCCCallFunc动作允许你从一个动作中调用一个方法。在连续动作的结尾这个方法很有用。举例:id actionTo = [CCMoveTo actionWithDuration: 2 position: ccp(s.width-40, s.height-40)];id actionBy = [CCMoveBy actionWithDuration: 2 position: ccp(80,80)];id actionCallFunc = [CCCallFunc actionWithTarget:self selector:@selector(doATask)];id 阅读全文
posted @ 2012-04-10 16:23 pengyingh 阅读(1430) 评论(0) 推荐(0)
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 125 下一页

导航