I'm in the middle of a project using Swift 1.1
and xCode 6.1.1
I receive the following error when trying to make seconds out of a Value and Timescale
PATH/ViewControllers/Camera/CaptureScreenViewController.swift:41:58: 'Int32' is not convertible to 'Int32'
on the line following line
var seconds = CMTimeMakeWithSeconds(Float64(value),timescale)
at ,timescale)
Below are a few lines for reference
var currentCellSegment = segmentForIndexPath(indexPath)
var value = currentCellSegment.duration.value.value
var timescale = currentCellSegment.duration.timescale.value
var seconds = CMTimeMakeWithSeconds(Float64(value),timescale)
Any suggestions on how to fix? Or answers to why this is happening?
Things I have tried
I have already uninstalled xCode, restarted, and re-installed.
I've already tried to cast timescale
as Int32
like so
var timescale = currentCellSegment.duration.timescale.value as Int32
var timescale: Int32 = currentCellSegment.duration.timescale.value
var timescale: Int32 = currentCellSegment.duration.timescale.value as Int32
, but I receive the error on the line var timescale...
as suggested by @martin-r
new reference code
var currentCellSegment = segmentForIndexPath(indexPath)
var value = currentCellSegment.duration.value
var timescale = currentCellSegment.duration.timescale
var seconds = CMTimeMakeWithSeconds(Float64(value),timescale)
Solved