0
그것은 오디오 재생 목록스위프트 - jQuery과
을 변경하는 방법import UIKit
import MediaPlayer
class TableView: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet var tableView: UITableView!
var tableData = MPMediaQuery.playlistsQuery()
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
self.tableView.reloadData()
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.tableData.collections.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell: UITableViewCell = self.tableView.dequeueReusableCellWithIdentifier("cell") as UITableViewCell
let playlist: MPMediaPlaylist = tableData.collections[indexPath.row] as MPMediaPlaylist
let playlistName = playlist.valueForProperty(MPMediaPlaylistPropertyName) as NSString
cell.textLabel?.text = playlistName
return cell
}
func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) {
println("Row \(indexPath.row) selected")
}
}
에 대한 jQuery과 인,의 TableView의 앨범을 가지고? 0x1002364b0 :
내가var tableData = MPMediaQuery.albumsQuery()
에 var tableData = MPMediaQuery.playlistsQuery()
을 변경 tryed하지만 정확하지 않은, 엑스 코드는 나에게 오류 제공 BRK 번호를 1
tableView의 위임을 할당 한 곳을 확인하십시오 (Interface Builder?). 보기 컨트롤러가 아닌 UIView 인스턴스로 설정됩니다. – Paulw11