나는 두 개의 날짜 선택기를 UIView에 가지고 있으며 핵심 데이터를 사용하여 출력을 저장하고 해당 데이터를 UITable보기로 표시하는 방법을 알아 내려고하고 있습니다. 지금 내 tableViewController에 있습니다 :datePicker에서 테이블 뷰로 데이터 추가하기
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
// Configure the cell...
let CellID: NSString = "Cell"
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(CellID) as UITableViewCell
if let ip = indexPath as NSIndexPath! {
var data: NSManagedObject = myLog[indexPath.row] as NSManagedObject
cell.textLabel.text = data.valueForKeyPath("punchInTime") //error here (AnyObject is not identical to 'String')
}
return cell
}
이 오류를 해결하는 방법을 모르겠습니다. 나는 단지 텍스트 필드 대신 날짜 선택기를 사용하고 내가 배우는대로 학습하는 https://www.youtube.com/watch?v=4ymz6i07DRM을 따라 왔습니다. 하지만 어딘가에서 뭔가 빠졌어요.
감사