草庐IT

SEARCH_TYPE_DISPATCH

全部标签

xcode - Swift 中的 "Use of undeclared type",即使类型是内部的,并且存在于同一模块中

我的模块中有一个类型:importCocoaclassColoredDotView:NSView{...}它被用在许多不同的类中,没有问题:classEditSubjectPopoverController:NSObject{@IBOutletinternalvarsubjectColorDotView:ColoredDotView!...}但由于某些原因,当我在一个特定类中使用它时,我在类型上出现编译错误:classEditTaskPopoverController:NSObject{@IBOutletinternalvarlowPriorityDotView:ColoredDotV

ios - libc++abi.dylib : terminating with uncaught exception of type NSException (lldb)

想要改进此帖子?提供此问题的详细答案,包括引用和对答案正确原因的解释。不够详细的答案可能会被编辑或删除。我正在快速编写一个应用程序,当我在iPhone模拟器上运行测试应用程序时,一切正常,但随后我尝试向右滑动,这是我为它添加到下一页的手势(查看Controller二)它崩溃并在控制台日志中显示此错误报告。2014-10-1812:07:34.400soundtest[17081:818922]***Terminatingappduetouncaughtexception'NSUnknownKeyException',reason:'[setValue:forUndefinedKey:]

ios - libc++abi.dylib : terminating with uncaught exception of type NSException (lldb)

想要改进此帖子?提供此问题的详细答案,包括引用和对答案正确原因的解释。不够详细的答案可能会被编辑或删除。我正在快速编写一个应用程序,当我在iPhone模拟器上运行测试应用程序时,一切正常,但随后我尝试向右滑动,这是我为它添加到下一页的手势(查看Controller二)它崩溃并在控制台日志中显示此错误报告。2014-10-1812:07:34.400soundtest[17081:818922]***Terminatingappduetouncaughtexception'NSUnknownKeyException',reason:'[setValue:forUndefinedKey:]

swift - 我如何在 Swift 3、Swift 4 及更高版本中使用 dispatch_sync、dispatch_async、dispatch_after 等?

我在Swift2.x(甚至1.x)项目中有很多代码如下所示://Movetoabackgroundthreadtodosomelongrunningworkdispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0)){letimage=self.loadOrGenerateAnImage()//BouncebacktothemainthreadtoupdatetheUIdispatch_async(dispatch_get_main_queue()){self.imageView.image=i

swift - 我如何在 Swift 3、Swift 4 及更高版本中使用 dispatch_sync、dispatch_async、dispatch_after 等?

我在Swift2.x(甚至1.x)项目中有很多代码如下所示://Movetoabackgroundthreadtodosomelongrunningworkdispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0)){letimage=self.loadOrGenerateAnImage()//BouncebacktothemainthreadtoupdatetheUIdispatch_async(dispatch_get_main_queue()){self.imageView.image=i

ios - Xcode 8/swift 3 : "Expression of type UIViewController? is unused" warning

我有以下函数,它之前编译得很干净,但在Xcode8中生成了警告。funcexitViewController(){navigationController?.popViewController(animated:true)}"Expressionoftype"UIViewController?"isunused".为什么会这样说,有没有办法删除它?代码按预期执行。 最佳答案 长话短说popViewController(animated:)返回UIViewController?,并且编译器发出警告,因为您没有捕获该值。解决方案是将其分

ios - Xcode 8/swift 3 : "Expression of type UIViewController? is unused" warning

我有以下函数,它之前编译得很干净,但在Xcode8中生成了警告。funcexitViewController(){navigationController?.popViewController(animated:true)}"Expressionoftype"UIViewController?"isunused".为什么会这样说,有没有办法删除它?代码按预期执行。 最佳答案 长话短说popViewController(animated:)返回UIViewController?,并且编译器发出警告,因为您没有捕获该值。解决方案是将其分

ios - 如何在 Swift 3、4 和 5 中编写 dispatch_after GCD?

在Swift2中,我能够使用dispatch_after来延迟一个使用grandcentraldispatch的Action:vardispatchTime:dispatch_time_t=dispatch_time(DISPATCH_TIME_NOW,Int64(0.1*Double(NSEC_PER_SEC)))dispatch_after(dispatchTime,dispatch_get_main_queue(),{//yourfunctionhere})但是自Swift3以来,这似乎不再编译。在现代Swift中编写它的首选方法是什么? 最佳答案

ios - 如何在 Swift 3、4 和 5 中编写 dispatch_after GCD?

在Swift2中,我能够使用dispatch_after来延迟一个使用grandcentraldispatch的Action:vardispatchTime:dispatch_time_t=dispatch_time(DISPATCH_TIME_NOW,Int64(0.1*Double(NSEC_PER_SEC)))dispatch_after(dispatchTime,dispatch_get_main_queue(),{//yourfunctionhere})但是自Swift3以来,这似乎不再编译。在现代Swift中编写它的首选方法是什么? 最佳答案

objective-c - dispatch_after - Swift 中的 GCD?

我已经完成了iBook来自Apple,但找不到它的任何定义:谁能解释一下dispatch_after的结构?dispatch_after(,,) 最佳答案 我经常使用dispatch_after,所以我写了一个顶级实用函数来简化语法:funcdelay(delay:Double,closure:()->()){dispatch_after(dispatch_time(DISPATCH_TIME_NOW,Int64(delay*Double(NSEC_PER_SEC))),dispatch_get_main_queue(),closu