前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >扒虫篇- Bug日志 Ⅷ

扒虫篇- Bug日志 Ⅷ

作者头像
進无尽
发布2018-09-12 17:09:21
7150
发布2018-09-12 17:09:21
举报
文章被收录于专栏:進无尽的文章進无尽的文章

1. 以可变容器数量为最大值进行双层for循环中可变容器添删元素时造成的数据遗漏

代码语言:javascript
复制
for (int i = 0; i<self.AreaArray.count; i++) {
     Nodes *nodesP = self.AreaArray[i];
     if (!nodesP.haveChild) {
         BOOL jian = NO;
         for (int j = 0; j<AArray.count; j++) {
             if (jian) {
                 j--;
             }
             jian = NO;
             Nodes *nodes = AArray[j];
             if ([nodes.parentId isEqualToString: nodesP.nodeId]) {
                 nodes.depth = nodesP.depth+1;
                 nodesP.haveChild = YES;
                 [AArray removeObject:nodes];
                 [self.AreaArray addObject:nodes];
                 jian = YES;
             }
         }
     }
 }
 if (AArray.count>0) {
      [self.AreaArray addObject:AArray[0]];
 }
 dispatch_async(dispatch_get_main_queue(), ^{
     dataArray(self.AreaArray);
 });

上面的场景是筛选节点时出现的算法,里面有几个问题需要注意:

  • 1. 以self.AreaArray.count、AArray.count作为循环最大值,但是在循环的时候,又修改了self.AreaArray、AArray中的数据(数量多了、少了)。
  • 2. jian 是记录了上个循环中AArray删除了数据的操作,以保证这次循环中使 j -1,这样才能保证不漏掉AArray里面未被遍历的元素。
  • 3. 但是,当AArray里面只剩最后一个元素的时候,因为在执行for循环的时候,i都要++,所以不管怎样,此时最小的 i 也是 1,1 不小于1,所以for循环的最后一次不会被执行,造成的结果就是AArray里面有一个元素未被遍历,被遗漏了。
  • 4. 所以需要再最后的时候,强制把AArray里面的最后一个元素加到self.AreaArray中。

2. 封装的图片选择上传工具类中UIImagePickerControllerDelegate不执行

代码语言:javascript
复制
@interface ImageUploaderManager : NSObject

不执行的原因是 在VC中使用这个ImageUploaderManager时,需要设置为全局变量,如果是局部变量的话,很快会被销毁掉,其中的代理自然不会执行了。

3. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to transfer an animation to an animation state that is not a direct child of the animation's animation state.'

清理退出工程后又好了。

4. Launch Screen.storyboard 报错: Safe Area Layout Guide before iOS 9.0

下面这样操作就好了。

5. cocopods工程中Archive时 ld: library not found for -lAFNetworking

解决办法:重新 pod install ,然后 clean后就不会报错了。

6. 好好的突然网络请求就不会返回数据了

今天遇到一个很蛋疼的问题,好好的,参数代码都没动,都跟之前的是一样的,但是就是突然AFNetworking的请求没有数据返回了,Clean后重新多次运行工程依然是这样?????

解决办法:卸载模拟器上的工程,重新运行后,新工程的网络请求就正常了。

7.工程中的 txt 文件就死活解析不出来

代码语言:javascript
复制
NSString *path = [[NSBundle mainBundle] pathForResource:@"lnglatInformation" ofType:@"txt"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSDictionary *idc  = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];

解决办法:不光要把文件拖到工程中,还要在 Copy Bundle Resources 中添加进去。添加进去后就可以解析出来了。

8.审核被拒

Guideline 4.3 - Design

This app duplicates the content and functionality of other apps submitted by you or another developer to the App Store, which is considered a form of spam.

Apps that simply duplicate content or functionality create clutter, diminish the overall experience for the end user, and reduce the ability of developers to market their apps.

The next submission of this app may require a longer review time, and this app will not be eligible for an expedited review until this issue is resolved.

Next Steps

Submitting apps designed to mislead or harm customers or evade the review process may result in the termination of your Apple Developer Program account. Review the Terms & Conditions of the Apple Developer Program to learn more about our policies regarding termination.

If you believe your app is compliant with the App Store Review Guidelines, you may submit an appeal. Alternatively, you may provide additional details about your app by replying directly to this message.

代码语言:javascript
复制
我碰到了这个问题,根本原因还是应用功能或界面雷同。

1)如果是机器审核被拒,一般收到的被拒信息第一句话基本上是这样的:

  Guideline4.3 - Design - Spam

  Yourapp duplicates the content and functionality of apps submitted to the AppStore, 
  which is considered a form of spam.

  2)如果是人工审核被拒,一般收到的被拒信息第一句话基本上是这样的:

   Guideline4.3 - Design - Spam

   We found that your app provides the same feature set as other apps submitted tothe App Store,     
   which is not appropriate to the App Store.

  针对机器审核被拒和人工审核被拒分别有对应的解决方法:

首先我很确认的是,我这个被拒是没有过机审, 我的解决办法:

代码语言:javascript
复制
 1、修改产品销售地区并且和苹果发邮件说明(见第四条之后)
 2、修改产品分类,改改产品内容 打造与原产品不同的产品侧重属性分类;(针对线上马甲包不多的情况下)
 3、修改logo,修改主色调;
 4、修改工程的名称,修改各个模块文件夹的名称(通过加前缀),修改大部分的类文件名称(通过加前缀),
    修改 scheme、Targets、 info.plist文件、 pch文件、宏定义文件的名称。
    其中1、2项没什么用,3、4项才是正解。

苹果被拒 4.3,和它的10种解决办法!

9.The file “wisdomCanteen” couldn’t be opened because you don’t have permission to view it.

点击红框中后会出现提示,并确认即可。

10.Could not locate device support files. This iPhone 6 is running iOS 11.2.6 (15D100), which may not be supported by this version of Xcode.

解决办法:此时需要升级 Xcode 到更新版本才行。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018.06.05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. 以可变容器数量为最大值进行双层for循环中可变容器添删元素时造成的数据遗漏
  • 2. 封装的图片选择上传工具类中UIImagePickerControllerDelegate不执行
  • 3. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to transfer an animation to an animation state that is not a direct child of the animation's animation state.'
  • 4. Launch Screen.storyboard 报错: Safe Area Layout Guide before iOS 9.0
  • 5. cocopods工程中Archive时 ld: library not found for -lAFNetworking
  • 6. 好好的突然网络请求就不会返回数据了
  • 7.工程中的 txt 文件就死活解析不出来
  • 8.审核被拒
    • Guideline 4.3 - Design
    • 9.The file “wisdomCanteen” couldn’t be opened because you don’t have permission to view it.
    • 10.Could not locate device support files. This iPhone 6 is running iOS 11.2.6 (15D100), which may not be supported by this version of Xcode.
    相关产品与服务
    容器服务
    腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档