美文网首页
无标题文章

无标题文章

作者: 思考搜索决策勇敢 | 来源:发表于2017-03-12 15:48 被阅读11次

    报错:[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:]

    [self.oneArrayremoveObjectAtIndex:indexPath.section];//值数组

    [self.twoArrayremoveObjectAtIndex:indexPath.section];//键数组

    [self.collectionViewdeleteSections:[NSIndexSetindexSetWithIndex:indexPath.section]];

    我们想删除一个collectionviewcell,首先要做的,是清除以前对应这个cell的数据,我们容易忘记,清除键数组,会造成上面的错误。

    二、低级错误

    - (void)oneMethodAction  {

    NSString* oneID =  [[NSUserDefaults standardUserDefaults] objectForKey:koneid];

    NSString *urlStr = [NSString stringWithFormat:@"%@child-photo-count/%@",url,oneID];

    NSDictionary *dic = @{@"data":@{@"type":@"capture",@"attributes":@{@"incr":@(5)}}};

    [[NetAFHTTPSessionManager sharedInstance] PUT:urlStr parameters:dic success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {

    NSLog(@"photoCount  responseObject ==== %@",responseObject);

    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {

    }

    我们在调用一个接口时,接口也通了,然后就是数据没有上传,后面发现我们本来应该传一个孩子的id,其实我们只是上传了一个孩子的键,但是接口却通了,我们怎么也没想到是参数传入错误了。

    1、这问题当然后台有问题,但是,作为一个程序员,我们的思路还是有误,但所有的都排查了,还剩一个低级错误没有排查,这就是为什么我么提倡打log,打log是将各个参数都展示出来看看,我们认为有些写的是对的,理所当然,但是其实犯低级错误也是一种。

    2、命名尽量规范,不要讲长得类似的名字命在一起,同时不能将拼音和英语混合在一起,尽量使用英文。

    三、代码attention

    hidden不要写在动画里面 ,但是alpha可以,同时尽量减少弹框。

    相关文章

      网友评论

          本文标题:无标题文章

          本文链接:https://www.haomeiwen.com/subject/vootnttx.html