2014-09-03 5 views
0

다음은 제 코드입니다. 내가 UITableViewAnimation.Automatic을 시도Xcode-beta 7로 업그레이드 한 후 이상한 컴파일 오류가 발생했습니다.

Use of unresolved identifier 'Automatic'

:

 var indexPath = self.tableView.indexPathForCell(cell) 
     self.tableView.beginUpdates() 
     self.tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation:.Automatic) 
     self.tableView.endUpdates() 

나는 다음과 같은 컴파일 오류가 발생했습니다. 그러나 실패했습니다.

무엇이 문제입니까? 감사.

+0

'UITableViewRowAnimation을 사용해보세요. 자동' –

답변

1

오류 메시지가 잘못 표시되었습니다. 은 엑스 코드에서 6 베타 7, indexPathForCell()옵션 반환, 그래서 당신은 을 푸는 또는 조건부 할당을 사용해야합니다 :

if let indexPath = self.tableView.indexPathForCell(cell) { 
    self.tableView.beginUpdates() 
    self.tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic) 
    self.tableView.endUpdates() 
} 

(단 하나의 행 이 begin/EndUpdates를 호출하면 정말 필요하지 않습니다 경우 업데이트 됨.)

관련 문제