2014-10-30 3 views
4

내가 여기신속 최우선 방법

Overriding method with selector 'initWithStyle:reuseIdentifier:' has incompatibe type '(UITableViewCellStyle, String) -> SweetTableViewCell' 

를 컴파일하려고 때 최근 오류를 제공하는 코드의 라인이있어 신속 배우고 난이 오류가 이전 베타 버전에서 프로젝트를 열 때 봤는데

override init(style: UITableViewCellStyle, reuseIdentifier: String) { 
    super.init(style: style, reuseIdentifier: reuseIdentifier) 
    // Initialization code 
} 

답변

3

:

init(style: UITableViewCellStyle, reuseIdentifier: String?) 
                 ^

reuseIdentifier 이제 선택적 문자열입니다.

1

Apple은 새로운 XCode 버전에서 많은 인수와 메소드 값을 옵션으로 제공합니다. 두 번째 인수 인 reuseIdentifierString?이 아니고 String이되어야합니다. UITableViewCell에서 init 방법이 약간 변경 되었기 때문에입니다