Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在swift中获取断点1.1错误运行时_Swift - Fatal编程技术网

在swift中获取断点1.1错误运行时

在swift中获取断点1.1错误运行时,swift,Swift,我构建了一个包含四个组件的UIPickerView,我想将选择的每个组件和行分配给我的VAR,但是我在这个函数中得到了线程1:breakpoint 1.1运行时错误 func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int){ println("jjjj") println(component) switch(component){

我构建了一个包含四个组件的UIPickerView,我想将选择的每个组件和行分配给我的VAR,但是我在这个函数中得到了线程1:breakpoint 1.1运行时错误

    func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int){
    println("jjjj")
    println(component)
    switch(component){
    case 0:
        person = persons [component][row]
    case 1:
        year = persons [component][row]
    case 2:
        month = persons [component][row]
    case 3:
        day = persons [component][row]
    default : break

    }
}
我的完整代码是

import Foundation
import UIKit


class VariziJadidController: UIViewController,UIPickerViewDelegate,UIPickerViewDataSource {
@IBOutlet weak var mablagh: UITextField!
var person = ""
var year = ""
var month = ""
var day = ""

var persons = [
["احمد","حسین","حمید","مهدی","رضا"]
,["1394" , "1395" , "1396" , "1397" , "1398" , "1399" , "1400"]
,["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"]
,["31" , "30" , "29" , "28" , "27" , "26" , "25" , "24" , "23" , "22" , "21" , "20" , "19" , "18", "17" , "16" , "15" , "14" , "13" , "12" , "11" , "10" , "9" , "8" , "7" ,"6" , "5" , "4" , "3" , "2" , "1"]
]
override func viewDidLoad() {
    super.viewDidLoad()
}


func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int{
   return persons.count
}
func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int{
    return persons [component].count
}
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String!{
    return persons [component][row]
}
func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int){
    println("jjjj")
    println(component)
    switch(component){
    case 0:
        person = persons [component][row]
    case 1:
        year = persons [component][row]
    case 2:
        month = persons [component][row]
    case 3:
        day = persons [component][row]
    default : break

    }
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    var mojodiTemp : MojoodiSandoghController = segue.destinationViewController as MojoodiSandoghController
    mojodiTemp.tempMojoodi = mablagh.text!
    var HesabeHarFard : SoratHesabeAaza = segue.destinationViewController as SoratHesabeAaza
    HesabeHarFard.person.text = person
    HesabeHarFard.year.text = year
    HesabeHarFard.month.text = month
    HesabeHarFard.day.text = day
} 
}


我如何解决这个问题?

哪一行抛出了错误?打印出了什么?@tbondwilkinson print out(lldb)和这一行的“println(“jjj”)”中是否意外设置了断点?检查Xcode中代码的左边距将其更改为
print
而不是
println
<代码>打印项次在swift 2.0中被弃用