小编kri*_*l99的帖子

Swift中下标的模糊使用

在我的Swift代码中,我不断收到"模糊使用下标"的错误.我不知道是什么导致了这个错误.它只是随机弹出.这是我的代码:

if let path = NSBundle.mainBundle().pathForResource("MusicQuestions", ofType: "plist") {
    myQuestionsArray = NSArray(contentsOfFile: path)
}

var count:Int = 1
let currentQuestionDict = myQuestionsArray!.objectAtIndex(count)

if let button1Title = currentQuestionDict["choice1"] as? String {
    button1.setTitle("\(button1Title)", forState: UIControlState.Normal)
}

if let button2Title = currentQuestionDict["choice2"] as? String {
    button2.setTitle("\(button2Title)", forState: UIControlState.Normal)
}

if let button3Title = currentQuestionDict["choice3"] as? String {
    button3.setTitle("\(button3Title)", forState: UIControlState.Normal)
}
if let button4Title = currentQuestionDict["choice4"] as? String {
    button4.setTitle("\(button4Title)", forState: UIControlState.Normal)
}

if let question = currentQuestionDict["question"] as? String!{
    questionLabel.text = "\(question)" …
Run Code Online (Sandbox Code Playgroud)

arrays subscript swift

26
推荐指数
2
解决办法
3万
查看次数

Xcode编译错误

我在使用Xcode的代码中反复出现此错误.

<unknown>:0: error: merge-module command failed with exit code 1 (use -v to see invocation)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
Run Code Online (Sandbox Code Playgroud)

我已经尝试了一些我能找到的关于如何解决问题的方法,但没有任何效果.我已经将我的优化级别切换为无[-Onone],我已经执行了清理并且我在终端中运行了xcodebuild函数,但没有任何工作.有关如何解决此问题的任何想法?

xcode command ios swift

6
推荐指数
1
解决办法
2194
查看次数

标签 统计

swift ×2

arrays ×1

command ×1

ios ×1

subscript ×1

xcode ×1