Swift 프로그래밍에서 새로운 기능을 제공하므로 저를 강하게 판단하지 마십시오. 문제가있는 곳을 이해하려고 많은 시간을 보냈지만 얻을 수는 없습니다. 나는 스토리 보드에 부착 한 라벨 - 나는 myLabel
을 내 사용자 지정있는 UITableViewCell 클래스에서UILabel이 UITableViewCell 사용자 정의 클래스로 업데이트되지 않았습니다. Swift
@IBOutlet weak var myTableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
myTableView.delegate = self
myTableView.dataSource = self
}
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 10
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! MyTableViewCell
cell.createNewCell()
return cell
}
:
은 내가 UIViewController에
의 UIViewController의 내부 jQuery과가있다.
@IBOutlet weak var myLabel: UILabel!
func createNewCell(){
myLabel.text = "1234567"
}
하지만 cellForRowAtIndexPath
에 다음 줄 cell.textLabel!.text = "12312"
를 추가하면 내가 커스텀있는 UITableViewCell 클래스를 통해 업데이트하려고 할 때 내 세포 업데이트, 셀은 업데이트되지 않습니다.
나는 당신의 질문을 편집했지만 아직도 무엇을 요구하고 있는지 분명하지 않습니다. 마지막 두 문장이 명확하지 않습니다 – Honey