Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我在Debug和Release中有一个完成块的奇怪行为. 例如: sourceViewController.presentViewController(ccVC, animated: true, completion: { () -> Void in NSUserDefaults.standardUserDefaults().setBool(true, forKey: kC 我在DeBUG和Release中有一个完成块的奇怪行为.
例如:

sourceVIEwController.presentVIEwController(ccVC,animated: true,completion: { () -> VoID in            NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)            NSUserDefaults.standardUserDefaults().synchronize()            println("save bolean")        })

调试中:
   println(“save bolean”)打印字符串
在重新:
 println(“save bolean”)什么都不打印

对这种行为有什么想法吗?
有人试验一个明确的解决方案?


安德里亚

解决方法 它看起来像这里讨论的Swift编译器错误(至少版本1.1):
https://github.com/ReactiveCocoa/ReactiveCocoa/issues/1632

发布版本中,有时不会调用闭包,特别是当它们按顺序排序时:

array.map({ 
func completionHandler() {    NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)    NSUserDefaults.standardUserDefaults().synchronize()    println("save bolean")}sourceVIEwController.presentVIEwController(ccVC,completion: completionHandler)
* 2 }).map({ [+++] * 3 }).map({ [+++] * 4 })...

该问题仅出现在Swift中,而不是出现在Objective-C中.如果您的应用程序不需要通过优化获得更好的性能,则可以通过将Swift编译器优化级别设置为无[-Onone]来进行设计.

或者另一种解决方法是将闭包命名为函数:

[+++]

我将以前的解决方法用于我的项目,因为我希望保持我的代码简单,并且不需要通过优化来提高性能.

总结

以上是内存溢出为你收集整理的Swift presentViewController完成块仅在未在发布中调用的调试中工作全部内容,希望文章能够帮你解决Swift presentViewController完成块仅在未在发布中调用的调试中工作所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 4, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我在Debug和Release中有一个完成块的奇怪行为. 例如: sourceViewController.presentViewController(ccVC, animated: true, completion: { () -> Void in NSUserDefaults.standardUserDefaults().setBool(true, forKey: kC 我在DeBUG和Release中有一个完成块的奇怪行为.
例如:

sourceVIEwController.presentVIEwController(ccVC,animated: true,completion: { () -> VoID in            NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)            NSUserDefaults.standardUserDefaults().synchronize()            println("save bolean")        })

调试中:
   println(“save bolean”)打印字符串
在重新:
 println(“save bolean”)什么都不打印

对这种行为有什么想法吗?
有人试验一个明确的解决方案?


安德里亚

解决方法 它看起来像这里讨论的Swift编译器错误(至少版本1.1):
https://github.com/ReactiveCocoa/ReactiveCocoa/issues/1632

发布版本中,有时不会调用闭包,特别是当它们按顺序排序时:

array.map({ 
func completionHandler() {    NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)    NSUserDefaults.standardUserDefaults().synchronize()    println("save bolean")}sourceVIEwController.presentVIEwController(ccVC,completion: completionHandler)
* 2 }).map({ * 3 }).map({ [+++] * 4 })...

该问题仅出现在Swift中,而不是出现在Objective-C中.如果您的应用程序不需要通过优化获得更好的性能,则可以通过将Swift编译器优化级别设置为无[-Onone]来进行设计.

或者另一种解决方法是将闭包命名为函数:

[+++]

我将以前的解决方法用于我的项目,因为我希望保持我的代码简单,并且不需要通过优化来提高性能.

总结

以上是内存溢出为你收集整理的Swift presentViewController完成块仅在未在发布中调用的调试中工作全部内容,希望文章能够帮你解决Swift presentViewController完成块仅在未在发布中调用的调试中工作所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 5, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我在Debug和Release中有一个完成块的奇怪行为. 例如: sourceViewController.presentViewController(ccVC, animated: true, completion: { () -> Void in NSUserDefaults.standardUserDefaults().setBool(true, forKey: kC 我在DeBUG和Release中有一个完成块的奇怪行为.
例如:

sourceVIEwController.presentVIEwController(ccVC,animated: true,completion: { () -> VoID in            NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)            NSUserDefaults.standardUserDefaults().synchronize()            println("save bolean")        })

调试中:
   println(“save bolean”)打印字符串
在重新:
 println(“save bolean”)什么都不打印

对这种行为有什么想法吗?
有人试验一个明确的解决方案?


安德里亚

解决方法 它看起来像这里讨论的Swift编译器错误(至少版本1.1):
https://github.com/ReactiveCocoa/ReactiveCocoa/issues/1632

发布版本中,有时不会调用闭包,特别是当它们按顺序排序时:

array.map({ 
func completionHandler() {    NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)    NSUserDefaults.standardUserDefaults().synchronize()    println("save bolean")}sourceVIEwController.presentVIEwController(ccVC,completion: completionHandler)
* 2 }).map({ * 3 }).map({ * 4 })...

该问题仅出现在Swift中,而不是出现在Objective-C中.如果您的应用程序不需要通过优化获得更好的性能,则可以通过将Swift编译器优化级别设置为无[-Onone]来进行设计.

或者另一种解决方法是将闭包命名为函数:

[+++]

我将以前的解决方法用于我的项目,因为我希望保持我的代码简单,并且不需要通过优化来提高性能.

总结

以上是内存溢出为你收集整理的Swift presentViewController完成块仅在未在发布中调用的调试中工作全部内容,希望文章能够帮你解决Swift presentViewController完成块仅在未在发布中调用的调试中工作所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Swift presentViewController完成块仅在未在发布中调用的调试中工作_app_内存溢出

Swift presentViewController完成块仅在未在发布中调用的调试中工作

Swift presentViewController完成块仅在未在发布中调用的调试中工作,第1张

概述我在Debug和Release中有一个完成块的奇怪行为. 例如: sourceViewController.presentViewController(ccVC, animated: true, completion: { () -> Void in NSUserDefaults.standardUserDefaults().setBool(true, forKey: kC 我在DeBUG和Release中有一个完成块的奇怪行为.
例如:

sourceVIEwController.presentVIEwController(ccVC,animated: true,completion: { () -> VoID in            NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)            NSUserDefaults.standardUserDefaults().synchronize()            println("save bolean")        })

调试中:
   println(“save bolean”)打印字符串
在重新:
 println(“save bolean”)什么都不打印

对这种行为有什么想法吗?
有人试验一个明确的解决方案?


安德里亚

解决方法 它看起来像这里讨论的Swift编译器错误(至少版本1.1):
https://github.com/ReactiveCocoa/ReactiveCocoa/issues/1632

发布版本中,有时不会调用闭包,特别是当它们按顺序排序时:

array.map({ 
func completionHandler() {    NSUserDefaults.standardUserDefaults().setBool(true,forKey: kChromeCastInstructionsShown)    NSUserDefaults.standardUserDefaults().synchronize()    println("save bolean")}sourceVIEwController.presentVIEwController(ccVC,completion: completionHandler)
* 2 }).map({ * 3 }).map({ * 4 })...

该问题仅出现在Swift中,而不是出现在Objective-C中.如果您的应用程序不需要通过优化获得更好的性能,则可以通过将Swift编译器优化级别设置为无[-Onone]来进行设计.

或者另一种解决方法是将闭包命名为函数:

我将以前的解决方法用于我的项目,因为我希望保持我的代码简单,并且不需要通过优化来提高性能.

总结

以上是内存溢出为你收集整理的Swift presentViewController完成块仅在未在发布中调用的调试中工作全部内容,希望文章能够帮你解决Swift presentViewController完成块仅在未在发布中调用的调试中工作所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1010272.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存