Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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
swift ios扩展使用xcode10给出分段错误11_Ios_Swift_Segmentation Fault_Xcode10 - Fatal编程技术网

swift ios扩展使用xcode10给出分段错误11

swift ios扩展使用xcode10给出分段错误11,ios,swift,segmentation-fault,xcode10,Ios,Swift,Segmentation Fault,Xcode10,我使用的是swift 3.1,xcode 10 beta,cocapods 1.5.3 extension WithdrawFlow where Self: ViewcontrollerAnimatedTransition { func navigate() ... } 但编译器在扩展所在行崩溃主要是由于使用了“where Self:ViewcontrollerAnimatedTransition” xcode 9工作正常。但xcode 10给出了以下信息: 在流量下为“导航入流(:)”发射

我使用的是swift 3.1,xcode 10 beta,cocapods 1.5.3

extension WithdrawFlow where Self: ViewcontrollerAnimatedTransition {
func navigate()
 ...
}
但编译器在扩展所在行崩溃主要是由于使用了“where Self:ViewcontrollerAnimatedTransition”

xcode 9工作正常。但xcode 10给出了以下信息:

  • 在流量下为“导航入流(:)”发射SIL时。swift:9:3
  • 而silgen发出函数SIL函数“@$S12Module12FilePaaSO41ViewControlleranimatedTransitionRZRLE0navigateine0YYSSF”。 对于流中的“导航(:)”。swift:9:3错误:分段错误:11
  • 有人能帮忙吗


    谢谢。

    我遇到了这个问题,通过使用默认值更改包含
    inout
    参数的函数,问题得到了解决。告诉我错误的函数是在我的应用程序中第一次调用它

    旧的:

    ///使用指定的着色颜色、图像和脉冲动画创建新的图标按钮
    便利初始化(带TintColor tint:inout BehaviorRelay=UIColor.navBarTintColor,
    着色图像:UIImage?,
    pulseAnimation:pulseAnimation=.CenterRadialByondBounds
    ) {
    self.init(图像:着色图像?.withRenderingMode(.alwaysTemplate))
    self.pulseAnimation=pulseAnimation
    _=(tint??UIColor.navBarTintColor).asObservable().subscribe(onNext:{[weak self](newColor)中的
    self?.tintColor=newColor
    self?.imageView?.tintColor=newColor
    })
    }
    
    新的:

    ///使用指定的着色颜色、图像和脉冲动画创建新的图标按钮
    便利初始化(TinteImage:UIImage?,
    pulseAnimation:pulseAnimation=.CenterRadialByondBounds
    ) {
    self.init(图像:着色图像?.withRenderingMode(.alwaysTemplate))
    self.pulseAnimation=pulseAnimation
    _=UIColor.navBarTintColor.asObservable().subscribe(onNext:{[weak self](newColor)中的
    self?.tintColor=newColor
    self?.imageView?.tintColor=newColor
    })
    }