摘要: 使用Category需要注意的点:(1) Category的方法不一定非要在@implementation中实现,也可以在其他位置实现,但是当调用Category的方法时,依据继承树没有找到该方法的实现,程序则会崩溃。(2) Category理论上不能添加变量,但是可以使用@dynamic来弥补这种... 阅读全文
posted @ 2015-08-25 10:02 caohaozhi 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #import "ViewController.h"#define kURL @"http://avatar.csdn.net/2/C/D/1_totogo2010.jpg"@interface ViewController ()@end@implementation ViewController-... 阅读全文
posted @ 2015-08-25 09:50 caohaozhi 阅读(73) 评论(0) 推荐(0) 编辑
摘要: - (void)viewDidLoad { [super viewDidLoad]; //启动线程,downloadImage为线程执行的方法,url为传入参数 NSURL *url ; [NSThread detachNewThreadSelector:@s... 阅读全文
posted @ 2015-08-25 09:44 caohaozhi 阅读(102) 评论(0) 推荐(0) 编辑
摘要: //触摸位置-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ NSSet *allTouches = [event allTouches]; //返回与当前接收者有关的所有的触摸对象 UITouch *... 阅读全文
posted @ 2015-08-24 09:59 caohaozhi 阅读(286) 评论(0) 推荐(0) 编辑
摘要: - (void)judge{ BOOL isNotifyAlert = NO, isNotifySound = NO; if (IOS8) { UIUserNotificationType types = [[UIApplication sharedApplicati... 阅读全文
posted @ 2015-08-24 09:33 caohaozhi 阅读(105) 评论(0) 推荐(0) 编辑
摘要: /** * View抖动效果 */- (void)shakeAnimationForView:(UIView *) view{ CALayer *viewLayer = view.layer; CGPoint position = viewLayer.position; CGPo... 阅读全文
posted @ 2015-06-26 10:24 caohaozhi 阅读(381) 评论(0) 推荐(0) 编辑