摘要: https://github.com/gabriel/gh-unit先记下来。 阅读全文
posted @ 2011-09-14 21:15 Gang.Wang 阅读(221) 评论(0) 推荐(0) 编辑
摘要: @interface Sample : NSObject { SEL action; id target; }@property SEL action;@property (assign) id target;-(void)addTarget:(id) t action:(SEL) s;-(void)sample_dosomthing;@end-----------------------------------#import "Sample.h"@implementation Sample@synthesize action;@synthesize target;-(vo 阅读全文
posted @ 2011-09-14 16:03 Gang.Wang 阅读(373) 评论(0) 推荐(0) 编辑
摘要: - (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 {UIGraphicsBeginImageContext(image1.size); // Draw image1[image1 drawInRect:CGRectMake(0, 0, image1.size.width, image1.size.height)]; // Draw image2[image2 drawInRect:CGRectMake(0, 0, image2.size.width, image2.size.height)]; UIImage * 阅读全文
posted @ 2011-09-14 15:41 Gang.Wang 阅读(399) 评论(1) 推荐(0) 编辑
摘要: 1.网上搜索字体文件(后缀名为.ttf,或.odf)2.把字体库导入到工程的resouce中3.在程序viewdidload中加载一下一段代码NSArray *familyNames = [UIFont familyNames];for( NSString *familyName in familyNames ){printf( "Family: %s \n", [familyName UTF8String] );NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];for( NSString *fo 阅读全文
posted @ 2011-09-14 15:34 Gang.Wang 阅读(12927) 评论(0) 推荐(0) 编辑
摘要: UIImage *img = [[UIImage imageNamed:@"badge.png"]stretchableImageWithLeftCapWidth:16.0 topCapHeight:0.0];拉升图片视线 阅读全文
posted @ 2011-09-14 15:33 Gang.Wang 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 加载图片我一直在用[UIImage imageNamed:@"test.png"]; 使用也算正常,之后突然常常出现memory warnings问题,了解原理后发现application bundle的顶层文件夹寻找由供应的名字的图象 。 如果找到图片,装载到iPhone系统缓存图象。那意味图片是(理论上)放在内存里作为cache的。所以加载的图片太多就会这样, 改为 imageWithContentofFile 就解决了,在使用的时候可以灵活运用,各有长处。 阅读全文
posted @ 2011-09-14 15:27 Gang.Wang 阅读(1923) 评论(0) 推荐(0) 编辑