【iOS】那些年,遇到的小坑

'NSInvalidArgumentException', reason: '-[__NSPlaceholderDictionary initWithObjectsAndKeys:]: second object of each pair must be non-nil.  Or, did you forget to nil-terminate your parameter list?'

解决方法:[[NSDictionary allocinitWithObjectsAndKeys  每个key和value都不能为nil,最后要加一个nil,另外数值类型的要加 @符号转换成对象

TabBarController 跳到子Controller时候,隐藏tabbar属性

解决方法:

ViewController *controller = [ViewController new];
controller.hidesBottomBarWhenPushed = YES;//隐藏bottomBar
[self.navigationController pushViewController:controller animated:YES];

 

UITableView add到某个添加了手势的View上,手势阻挡点击Cell事件的问题。解决方案:

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
    // 若为UITableViewCellContentView(即点击了tableViewCell),则不截获Touch事件
    if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) {
        return NO;
    }
    return  YES;
}
posted @ 2016-02-19 15:15  丶Pz  阅读(536)  评论(0编辑  收藏  举报