1
こんにちは、 によって私は私がしたいので、スウィフトの同等3スイフト3の「文字列を含む」機能と同等のスウィフト2は何ですか? npn.dev
mySong.contains Xcodeの7(上スウィフト2用
が何であるかを知っていただきたいと思いますiPhone 4用のアプリケーションを作成します)。私はフランス人だから私の英語のためにすみません...と、Google翻訳は
私のコード私を助け:
func gettingSongName(){
let folderURL = NSURL(fileURLWithPath: NSBundle.mainBundle().resourcePath!)
do{
let songPath = try NSFileManager.defaultManager().contentsOfDirectoryAtURL(folderURL, includingPropertiesForKeys: nil, options: .SkipsHiddenFiles)
for song in songPath{
var mySong = song.absoluteString
if mySong.contains(".mp3") { // Value of type 'String' has no member 'contains'
let findString = mySong.components(separatedBy: "/") // Value of type 'String' has no member 'components'
mySong = findString[findString.count-1]
mySong = mySong.replacingOccurrences(of: "%20", with: " ") // Value of type 'String' has no member 'replacingOccurences'
mySong = mySong.replacingOccurrences(of: "e%CC%81", with: "é") // Value of type 'String' has no member 'replacingOccurences'
mySong = mySong.replacingOccurrences(of: "e%CC%82", with: "ê") // Value of type 'String' has no member 'replacingOccurences'
mySong = mySong.replacingOccurrences(of: ".mp3", with: "") // Value of type 'String' has no member 'replacingOccurences'
songs.append(mySong)
print(mySong)
}
}
myTableView.reloadData()
}catch{
}
}
は npn.dev
ありがとう、私は試してみます –
@Pal Singh Anandを理解していません –
あなたが仲間を理解していないものはありますか? –