美文网首页
扒虫篇- Bug日志 Ⅷ

扒虫篇- Bug日志 Ⅷ

作者: 進无尽 | 来源:发表于2018-06-05 10:36 被阅读0次

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

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不执行

@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 文件就死活解析不出来

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.

我碰到了这个问题,根本原因还是应用功能或界面雷同。

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.

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

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

 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 到更新版本才行。

相关文章

  • 扒虫篇- Bug日志 Ⅸ

    1、UITabBarItem里设置的文字不显示 这样设置不显示。 这样设置就可以显示了。 2、解决Collecti...

  • 扒虫篇- Bug日志 Ⅹ

    1、NSDecimalNumber转基础数据类型时选择 double 比 float 更精确 2、一个奇怪的 Du...

  • 扒虫篇- Bug日志 Ⅷ

    1. 以可变容器数量为最大值进行双层for循环中可变容器添删元素时造成的数据遗漏 上面的场景是筛选节点时出现的算法...

  • 扒虫篇-Bug日志 Ⅵ

    1. Xcode中开发者账号登陆不上 试了试其他的账号也是一样,在账号密码没有输入错误的情况下还是登陆不上。解决办...

  • 扒虫篇-Bug日志 Ⅶ

    1. 移除UIView的所有子图层造成的崩溃 正确的姿势 2. 真机调试出现的问题 解决办法:iphone 上已经...

  • 扒虫篇-Bug日志Ⅴ

    1.The app references non--public selectors in Payload/xxx...

  • 扒虫篇-Bug日志Ⅳ

    1. Undefined symbols for architecture arm64: 解决办法:设置 Enab...

  • 扒虫篇-崩溃日志解读及Crash收集

    前言 崩溃是让发人员比较头痛的事情,app崩溃了,说明代码写的有问题,这时如何快速定位到崩溃的地方很重要。调试阶段...

  • 友盟bug日志分析

    友盟bug日志分析 一、友盟工具分析 1、去友盟后台,我的产品->移动统计->错误分析,找到有哪些bug日志,并把...

  • 《Go语言入门经典》16~18章读书笔记

    第16章调试 16.1 日志 日志并非为报告Bug而提供的,而是可供在Bug发生时使用的基础设施。 Go语言提供了...

网友评论

      本文标题:扒虫篇- Bug日志 Ⅷ

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