这是我在
Swift游乐场中运行的代码:
import Foundation import AudioToolBox var audioURL:NSURL = NSURL.fileURLWithPath("/path") var audioFile:UnsafePointer<AudioFileID> var audioCfUrl:CFURL = audioURL as CFURL AudioFileOpenURL(audioCfUrl!,Int8(kAudioFileReadPermission),&audioFile)
在最后一行我收到错误:
'NSURL' is not a subtype of CFURL