摘要: //这种写法明显不如下面的写法安全// [[self.staticDragViews objectAtIndex:dragView.tag] setAlpha:0.5]; //安全的写法 TKDragView *staticDragView = (TKDragView*)[self.staticDragViews objectAtIndex:dragView.tag]; if (staticDragView)[staticDragView setAlpha:0.3]; 阅读全文
posted @ 2013-06-29 22:04 ygm900 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 让一个view 或者控件不支持拖拽:dragView.userInteractionEnabled = NO; 阅读全文
posted @ 2013-06-29 21:27 ygm900 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 可变的数据变量一定要初始化之后才能再用,类似下面这样的步骤,任何时候都不能省。nsma_result = [[NSMutableArrayalloc]init];当然,有些属性除外。 阅读全文
posted @ 2013-06-29 21:08 ygm900 阅读(159) 评论(0) 推荐(0) 编辑
摘要: ResultVC *myResultVC = [[ResultVC alloc]initWithNibName:@"ResultVC" bundle:nil]; [self.view addSubview:myResultVC.view];以上为不良代码。原因:在xcode 4.5以上,或者使用了ARC设置的的项目中,myResultVC 在使用完之后会很快被释放。导致myResultVC.view 不能有返回按钮。 阅读全文
posted @ 2013-06-29 20:56 ygm900 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 转http://justcoding.iteye.com/blog/1473287 阅读全文
posted @ 2013-06-29 17:34 ygm900 阅读(166) 评论(0) 推荐(0) 编辑
摘要: UIImageView*view1=(UIImageView*)[self.viewviewWithTag:100]; 阅读全文
posted @ 2013-06-29 15:33 ygm900 阅读(889) 评论(0) 推荐(0) 编辑