码迷,mamicode.com
首页 >  
搜索关键字:self    ( 14215个结果
MACOS获得 CGContextRef 获得图片数据类型转换 NSImage、CIImage、CGImageRef
将NSImage转换为CIImage#import // convert NSImage to bitmapNSImage * myImage= [self currentImage];NSData* tiffData = [myImage TIFFRepresentation];NSBitmapI...
分类:其他好文   时间:2014-07-22 23:16:13    阅读次数:586
python运算符重载2
1、重载构造函数和减法运算__init__,__sub__ #file number.py class Number: def __init__(self,data): self.data = data def __sub__(self,other): return Number(se...
分类:编程语言   时间:2014-07-22 23:15:36    阅读次数:510
求一个数的最大素因子(python实现)
首先想到的是,将这个数进行素因子分解,得到所有的因子,然后取最大的。 首先写一个判断一个数是否是素数的方法: #judge a number whether a prime def judgePrime(self,number,pme): if number < 2: ...
分类:编程语言   时间:2014-05-01 09:05:26    阅读次数:3333
NSPredicate 的使用
NSPredicate:对self每个对象通过谓词进行筛选,判断是否与条件相匹配。作用相当于数据库的过滤取。主要用于从集合中分拣出符合条件的对象,也可以用于字符串的正则匹配第一、contains 判断 NSArray*array = [[NSArrayalloc]initWithObjects:.....
分类:其他好文   时间:2014-05-01 02:43:05    阅读次数:258
一个延时调用问题
如果用下面第1行的写法,调用[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(removeFromSuperview) object:nil];可以生效如果用下面第3行的写法,调用[NSObject c...
分类:其他好文   时间:2014-04-29 17:21:46    阅读次数:326
ios 隐藏状态栏,时间
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {         // iOS 7         [self prefersStatusBarHidden];         [self performSelector:@selector(setNeedsStatusBarAppear...
分类:移动开发   时间:2014-04-29 13:44:20    阅读次数:432
在view扣除正方形
- (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(ctx, .3, .3, .3, .1); CGContextFillRect(ctx, self.boun...
分类:其他好文   时间:2014-04-29 13:33:22    阅读次数:284
NSPredicate的使用
NSPredicate:对self每个对象通过谓词进行筛选,判断是否与条件相匹配。原理和用法都类似于SQL查询中的where,作用相当于数据库的过滤取。主要用于从集合中分拣出符合条件的对象,也可以用于字符串的正则匹配 第一、contains 判断         NSArray *array = [[NSArray alloc]initWithObjects:@"beijing",@"s...
分类:其他好文   时间:2014-04-29 13:32:23    阅读次数:375
Docker常用命令
Usage: docker [OPTIONS] COMMAND [arg...]  -H=[unix:///var/run/docker.sock]: tcp://host:port to bind/connect to or unix://path/to/socket to use A self-sufficient runtime for linux containers. Co...
分类:其他好文   时间:2014-04-28 10:17:41    阅读次数:359
降低UIViewController切换的耦合
我们一般切换UIViewController的时候用的是如下代码 #import "UIViewControllerDemo.h" UIViewControllerDemo *vc = [UIViewControllerDemo alloc] initWithNibName:nil bundle:nil] autorelease]; [self.navigationController pushViewController:vc animated:YES];...
分类:其他好文   时间:2014-04-27 21:21:00    阅读次数:294
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!