摘要:
#import <QuartzCore/QuartzCore.h>添加QuartzCore.framework库-(void) screenShot{ UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image= UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSLog(@"image:%@ 阅读全文
摘要:
//淡入淡出效果- (void) appear{ CGContextRef contextf = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:contextf]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [paintToolView setAlpha:1.0]; [UIView setAnimationDuration:4.0f]; [UIView commitAnimations];}- (void) disappear{ CG 阅读全文
摘要:
selector可以叫做选择器,其实指的就是对象的方法,也可以理解为C语言里面的函数指针,在面向对象里面的对应概念。[self performSelector:@selector(Hidden) withObject:nil afterDelay:2.8];//2.8秒之后调用selector里面的函数,很好用@selector(xxxx)的作用是找到名字为xxxx的方法。一般用于[aperformSelector:@selector(b)];就是说去调用a对象的b方法,和[ab];的意思一样,但是这样更加动态一些。@selector(xxxx)返回的类型是SEL,看方法说明的时候如果参数类型 阅读全文
摘要:
1、With ARC, you should use strong instead of retain and weak instead of assign when defining the properties.@interface Person : NSObject@property (nonatomic, strong) NSString *firstName;@property (nonatomic, strong) NSString *lastName;@property (nonatomic, strong) NSNumber *yearOfBirth;@property (no 阅读全文