Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Swift2 Dictionary updateValue函数在部署时会导致我的应用程序崩溃,但在模拟器中却能完美工作,为什么?_Ios_Iphone - Fatal编程技术网

Ios Swift2 Dictionary updateValue函数在部署时会导致我的应用程序崩溃,但在模拟器中却能完美工作,为什么?

Ios Swift2 Dictionary updateValue函数在部署时会导致我的应用程序崩溃,但在模拟器中却能完美工作,为什么?,ios,iphone,Ios,Iphone,假设这段代码根据满足的条件将字典中的“parentCategory”键更新为不同的值。我已经在iPhone5、5s、6和6s以及iPad2模拟器上测试并运行了这段代码,也在Xcode的真实设备上运行了这段代码,所有这些都可以运行。但是,当我使用“Save for Enterprise Deployment”对.ipa文件进行编码签名并导出时,应用程序会在这些行崩溃。我不确定到底是什么原因造成的,但错误是非常一致的。请帮我找到解决方案,谢谢 for video in item.ADVideos

假设这段代码根据满足的条件将字典中的“parentCategory”键更新为不同的值。我已经在iPhone5、5s、6和6s以及iPad2模拟器上测试并运行了这段代码,也在Xcode的真实设备上运行了这段代码,所有这些都可以运行。但是,当我使用“Save for Enterprise Deployment”对.ipa文件进行编码签名并导出时,应用程序会在这些行崩溃。我不确定到底是什么原因造成的,但错误是非常一致的。请帮我找到解决方案,谢谢

  for video in item.ADVideos{

      var mutable_video: Dictionary<String,String> = video

      if(self.level == 0){
            if(item.Parent != nil){
                try mutable_video.updateValue(item.Parent!, forKey: "parentCategory")
             }
      }

      if(self.level == 1){
            if(item.parentCategory != nil){
                 try mutable_video.updateValue(item.parentCategory!, forKey: "parentCategory")
            }                 
      }

      if(self.level == 2){
           if(item.parentCategory != nil){
                try mutable_video.updateValue(item.parentCategory!, forKey: "parentCategory")
            }
      }
      allVideos += [mutable_video]
  }
用于item.ADVideos中的视频{
可变变量视频:字典=视频
如果(self.level==0){
如果(item.Parent!=nil){
尝试可变的\u video.updateValue(item.Parent!,forKey:“parentCategory”)
}
}
如果(self.level==1){
如果(item.parentCategory!=nil){
试试mutable_video.updateValue(item.parentCategory!,forKey:“parentCategory”)
}                 
}
如果(self.level==2){
如果(item.parentCategory!=nil){
试试mutable_video.updateValue(item.parentCategory!,forKey:“parentCategory”)
}
}
所有视频+=[可变视频]
}

能否显示崩溃日志中的详细信息?能否显示崩溃日志中的详细信息?