swift初心者です。
音を出すアプリを試しに作っていますが下記エラーにはまってしまい進みません。
Argument labels (contetsOF, fileTypeHint) do not match any available overloads
解決方法を教えていただけますと幸いです。
コードは以下の通りです。
// // ViewController.swift // MyMusic // // Created by name on 2016/11/05. // Copyright © 2016年 mycompany. All rights reserved. // import UIKit import AVFoundation class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } //シンバルの音源ファイル var cymbalPath = Bundle.main.bundleURL.appendingPathComponent("cymbal.mp3") //シンバル用のプレイヤーインスタンスを作成 var cymbalPlayer = AVAudioPlayer() @IBAction func cymbal(_ sender: Any) { do{ //シンバル用のプレイヤーに音源ファイル名を指定 cymbalPlayer = try AVAudioPlayer(contetsOF: cymbalPath, fileTypeHint: nil) cymbalPlayer.play() } catch { print("シンバルでエラーが発生しました。") } } }
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。