【发布时间】:2015-03-31 19:54:53
【问题描述】:
我正在使用Swift 1.1 和xCode 6.1.1 进行项目
我在尝试从值和时间刻度中提取秒数时收到以下错误
PATH/ViewControllers/Camera/CaptureScreenViewController.swift:41:58: 'Int32' is not convertible to 'Int32'
在下一行
var seconds = CMTimeMakeWithSeconds(Float64(value),timescale)
,timescale)
以下是几行供参考
var currentCellSegment = segmentForIndexPath(indexPath)
var value = currentCellSegment.duration.value.value
var timescale = currentCellSegment.duration.timescale.value
var seconds = CMTimeMakeWithSeconds(Float64(value),timescale)
关于如何解决的任何建议?或者回答为什么会这样?
我尝试过的事情
我已经卸载了 xCode,重新启动并重新安装。
我已经尝试过像这样投射timescale as Int32
var timescale = currentCellSegment.duration.timescale.value as Int32
var timescale: Int32 = currentCellSegment.duration.timescale.value
var timescale: Int32 = currentCellSegment.duration.timescale.value as Int32
,但我在var timescale... 行收到错误
建议 @martin-r
新的参考代码
var currentCellSegment = segmentForIndexPath(indexPath)
var value = currentCellSegment.duration.value
var timescale = currentCellSegment.duration.timescale
var seconds = CMTimeMakeWithSeconds(Float64(value),timescale)
已解决
【问题讨论】:
标签: ios swift ios8.1 xcode6.1.1