摘要:下面的写法是错误的: CGFloatx =self.contentView.frame.origin.x; x =_lastDownX+ translation.x; self.contentView.frame.origin.x = x;正确的写法是: CGRectframe =self.c... 阅读全文
不合法语句 self.contentView.frame.origin.x = x;
2015-08-19 20:56 by dengchaojie_learner, 394 阅读, 0 推荐, 收藏,获取设备型号
2015-08-19 20:55 by dengchaojie_learner, 195 阅读, 0 推荐, 收藏,
摘要:6和6 plus真机测试报错:No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=armv7 arm7s)。解决方法是设置”Build Active Architecture On... 阅读全文
NSNotificationCenter
2015-08-19 20:54 by dengchaojie_learner, 128 阅读, 0 推荐, 收藏,
摘要:Observer可以用self.collectView // 2.监听收藏改变通知,并刷新数据 [[NSNotificationCenter defaultCenter] addObserver:self.collectionView selector:@selector(reloadData) n 阅读全文
Dictionary
2015-08-19 20:53 by dengchaojie_learner, 173 阅读, 0 推荐, 收藏,
摘要:对象 转换成 整型、浮点型。 intValue、floatValue cellDic[@"preFillValue"] floatValue] cellDic[@"unactivated"] intValue] [_citiesData valueForKeyPath:@"name"]; KVC(s 阅读全文
block
2015-08-19 20:52 by dengchaojie_learner, 167 阅读, 0 推荐, 收藏,
摘要:block方法和代理是可以互换的。 block只能用copy,用strong是没用的: @property (nonatomic, copy) void (^hideBlock)();// 没有返回值,没有参数 @property (nonatomic, copy) void (^setTitleB 阅读全文
iPad
2015-08-19 20:51 by dengchaojie_learner, 163 阅读, 0 推荐, 收藏,
摘要:2.在Ipad开发中,控制器view,默认,宽度取尺寸最小的值,高度取尺寸最大的值,高度永远大于宽度 3.面试题:如何做好Ipad屏幕旋转适配问题?解决方案:在主控制器先加个UIView(内容view), 之后将子控制器作为这个内容view的子视图就行了 阅读全文
NSString
2015-08-19 20:50 by dengchaojie_learner, 189 阅读, 0 推荐, 收藏,
摘要:string.uppercaseString,转换成大写 NSLog(@"%@",NSStringFromCGRect(self.view.frame));// NSStringFromCGRect,将CGRect转成字符串 犯了一个严重的错误: //1.2 删除拓展名 NSString *imgN 阅读全文
xib和storyboard的使用方法
2015-08-19 20:43 by dengchaojie_learner, 234 阅读, 0 推荐, 收藏,
摘要:initWithNibName加载xib或者storyboard // VC BLEViewController *controller = [[BLEViewController alloc] initWithNibName:@"BLEViewController" bundle:nil]; // 阅读全文
drawRect画线和使用CGContext
2015-08-19 20:42 by dengchaojie_learner, 245 阅读, 0 推荐, 收藏,
摘要:Quartz 2D绘图引擎,核心对象就是上下文 画线的一个自定义UILable -(void)drawRect:(CGRect)rect { [super drawRect:rect]; // 1.获得上下文 CGContextRef ctx = UIGraphicsGetCurrentContex 阅读全文
CGAffineTransform动画
2015-08-19 20:41 by dengchaojie_learner, 159 阅读, 0 推荐, 收藏,
摘要:NSTimer只适合做频率比较低的事情,每隔多少秒做什么事情。 CADisplayLink适合做频率比较高的事情。 [UIView beginAnimations:nil context:nil]; self.contentView.frame = frame; [UIView commitAnim 阅读全文
浙公网安备 33010602011771号