search

Home  >  Q&A  >  body text

objective-c - 怎么取得每个cell里的数字,并组成一个字符串

迷茫迷茫2763 days ago599

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-27 09:05:52

    If the design is reasonable, the data of each cell is encapsulated in the model, so it can be taken directly from the model

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-04-27 09:05:52

    Generally, the data in the cell will be placed in an array, which can be obtained directly by processing the array

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-04-27 09:05:52

    The number in your cell can be changed. I guess you want to get it directly from the cell. You can construct the NSIndexPath yourself. I assume that the data you want to retrieve is in section 0, and there are numCount rows in total, and the numbers are placed in numLable:

    var numString = ""
    for i in 0 ..< numCount {
        numString += tableView.cellForRowAtIndexPath(NSIndexPath(forRow: i, inSection: 0)).numLable.text
    }
    

    reply
    0
  • Cancelreply