Fork me on GitHub
上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 125 下一页

2012年3月1日

摘要: Ad Hoc iTunesAd Hoc iTunes 512*512 iTunesArtworkApp Store:iPhone/iPod touch 57*57 Icon.pngiPhone 4iPad 72*72 Icon-72.pngHome screen:iPhone/iPod touch 57*57 Icon.pngiPhone 4 114*114 Icon@2x.pngiPad 72*72 Icon-72.pngSettings:iPhone 29*29 Icon-Small.pngiPhone 4 58*58 Icon-Small@2x.pngiPad 29*29 Icon-Sm 阅读全文
posted @ 2012-03-01 15:25 pengyingh 阅读(196) 评论(0) 推荐(0)
摘要: 1 @implementation UIImage (grayscale)2 3 typedef enum {4 5 ALPHA = 0,6 7 BLUE = 1,8 9 GREEN = 2,10 11 RED = 312 13 } PIXELS;14 15 - (UIImage *)convertToGrayscale {16 17 CGSize size = [self size];18 19 int width = size.width;20 21 int height = size.height;22 23 24 // the pixels will be painted to thi 阅读全文
posted @ 2012-03-01 15:22 pengyingh 阅读(498) 评论(0) 推荐(0)
摘要: 添加一个UITapGestureRecognizer;然后:tgr= [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(MapTouched:)]; [MapView addGestureRecognizer:tgr];其中响应函数如下:- (void)MapTouched:(UITapGestureRecognizer*)t{ CGPointpt = [tlocationInView:MapView]; NSLog(@"%@",NSStringFromCGPoint(pt));} 阅读全文
posted @ 2012-03-01 15:18 pengyingh 阅读(319) 评论(0) 推荐(0)
摘要: NSDateFormatter *dateFormatter =[[NSDateFormatter alloc] init];// NSString *tzStr = [[date description] substringFromIndex:20];// NSLog(@"\ndate\t:[%@]\ntime zone\t:[%@]", [date description], tzStr);// [dateFormatter setTimeZone:tzStr];[dateFormatter setDateFormat:@"MM d','h:m 阅读全文
posted @ 2012-03-01 15:14 pengyingh 阅读(917) 评论(0) 推荐(0)
摘要: - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight这个函数是UIImage的一个实例函数,它的功能是创建一个内容可拉伸,而边角不拉伸的图片,需要两个参数,第一个是不拉伸区域和左边框的宽度,第二个参数是不拉伸区域和上边框的宽度。第一次用这个函数的时候一直搞不懂为什么只要两个参数就行,至少应该指定左上角和右下角,总共四个参数啊。后来读读文档才明白,只需要两个参数就行了。参数的意义是,如果参数指定10,5。那么,图片左边10个像素,上边5个 阅读全文
posted @ 2012-03-01 13:22 pengyingh 阅读(276) 评论(0) 推荐(0)
摘要: nonatomic:非原子性访问,不加同步,多线程并发访问会提高性能。如果不加此属性,则默认是两个访问方法都为原子型事务访问。 (atomic是Objc使用的一种线程保护技术,基本上来讲,是防止在写未完成的时候被另外一个线程读取,造成数据错误。而这种机制是耗费系统资源的,所 以在iPhone这种小型设备上,如果没有使用多线程间的通讯编程,那么nonatomic是一个非常好的选择。)assign:简单赋值,不更改索引计数对基础数据类型 (NSInteger)和C数据类型(int,float,double,char, 等)copy:建立一个索引计数为1的对象,然后释放旧对象 对NSStringre 阅读全文
posted @ 2012-03-01 10:05 pengyingh 阅读(4740) 评论(0) 推荐(0)
摘要: NSPredicate *p = [NSPredicate predicateWithFormat:@"SELF like[c] %@", @"aa*bb"];其中:SELF大小写都行。aa*bb使用了通配符,*号只能写在变量中,而不能这样@"SELF like[c] %@*%@", @"aa", @"bb"。字符串本来是要用引号括起来的,不过这里不用加,NSPredicate会自动加。测试布尔值 NSPredicate *p = [NSPredicate predicateWithFormat 阅读全文
posted @ 2012-03-01 09:55 pengyingh 阅读(207) 评论(0) 推荐(0)
摘要: 原始帖子只需要加入到pch文件中即可,__OPTIMIZE__这个编译选项是发布版本才有的,所以在编译调试版本的时候可以看到Log,而发布版本则没有Log。#ifndef __OPTIMIZE__#define NSLog(...) NSLog(__VA_ARGS__)#else#define NSLog(...) {}#endif 阅读全文
posted @ 2012-03-01 09:48 pengyingh 阅读(201) 评论(0) 推荐(0)
摘要: TableView.backgroundView=nil;TableView.backgroundColor=[UIColorclearColor];TableView.opaque=NO; 阅读全文
posted @ 2012-03-01 09:46 pengyingh 阅读(732) 评论(0) 推荐(0)
摘要: 只能输入非零开头的正整数用下面的代码- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ NSString *result = [textField.text stringByReplacingCharactersInRange:range withString:string]; if ([result length] == 0) return YES; // Allow delete ... 阅读全文
posted @ 2012-03-01 09:45 pengyingh 阅读(277) 评论(0) 推荐(0)
上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 125 下一页

导航