2016-09-07 2 views
2

좋은 오후, 내가 목표 C로 코딩되어 "STK 오디오 플레이어"라는 일부 오픈 소스 코드를 구현하기 위해 노력하고있는 음악 재생 응용 프로그램을 코딩을 시도"모호한 참조하는"스위프트의 오류 3

가져온 소스에서 메서드를 호출하려고하면 다음과 같은 컴파일 오류가 발생합니다.

인스턴스를

/// Plays an item from the given URL string (all pending queued items are removed). 
/// The NSString is used as the queue item ID 
-(void) play:(NSString*)urlString; 

답변

3

play 인스턴스 (-) 방법이다 오픈 소스에서

import UIKit 

class ViewController: UIViewController { 

var audioPlayer = STKAudioPlayer() 


override func viewDidLoad() { 
    super.viewDidLoad() 
    // Do any additional setup after loading the view, typically from a nib. 

    let songToPlay:String = "http://themarketshop.com/beats/fatbeat.mp3" 

    STKAudioPlayer.play(songToPlay) 
} 

override func didReceiveMemoryWarning() { 
    super.didReceiveMemoryWarning() 
    // Dispose of any resources that can be recreated. 
} 

}

"을 회원으로 모호한 참조 플레이", 그래서 사용

audioPlayer.play(songToPlay) 

이고 리터럴 문자열에 String으로 주석을 추가하지 마십시오. 컴파일러를 포함한 모든 사람들은 그것이 무엇인지 알 수 있습니다.

+0

나는 내가 거기에서 한 것을 본다 .....;) 고마워! – Mac

관련 문제