1
我有這個tableview有兩列(名字,第二個名字) 我填充tableview與數組中的數據。 現在我想了解,我可以添加一個「正常」行(人)和一個像瓷磚一樣的行。nstableview添加行作爲標題並設置連續編號
例如:
行1:男性人 行2:最大| Mustermann 第3排:Peter | Düllen
對於我試圖填補我的數組是這樣的:
Data(firstName: "male persons", secondName: "", typ: "titel")
Data(firstname: "Max", secondName: "Mustermann", typ: "person")
Data(firstname: "Peter", secondName: "Düllen", typ: "person")
它的工作原理,但是這是設置一排像一個標題正確的方法是什麼?
第二個問題: 每行應該在另一列中獲得一個連續的數字。我現在意識到那個行號的時候是 。但現在的問題是,標題行不應該獲得連續的數字。
小例子(在行的結尾是,我想實現的數字):
Data(firstName: "male persons", secondName: "", typ: "titel") []
Data(firstname: "Max", secondName: "Mustermann", typ: "person") [1]
Data(firstname: "Peter", secondName: "Düllen", typ: "person") [2]
Data(firstName: "male persons", secondName: "", typ: "titel") []
Data(firstname: "Max", secondName: "Mustermann", typ: "person") [3]
Data(firstname: "Peter", secondName: "Düllen", typ: "person")[4]
我怎樣才能解決這種情況呢? 我希望你能理解我的問題。