일부 코드를 검토 한 결과, UITableView
이고 datasource
및 delegate
이이 UITableView
인 UIViewController가 <UITableViewDataSource, UITableViewDelegate>
이라는 프로토콜을 선언하지 않고 단순히 프로토콜을 선언하지만 결코 프로토콜을 선언하지 않는다는 것을 깨달았습니다.UIViewController 데이터 원본 및 프로토콜을 준수하지 않고 UITableView 대리자로?
어떻게 심지어 문서 당? 노력하고 있습니다 :
dataSource
The object that acts as the data source of the receiving table view.
@property(nonatomic, assign) id<UITableViewDataSource> dataSource
Discussion
The data source must adopt the UITableViewDataSource protocol. The data source is not retained.
delegate
The object that acts as the delegate of the receiving table view.
@property(nonatomic, assign) id<UITableViewDelegate> delegate
Discussion
The delegate must adopt the UITableViewDelegate protocol. The delegate is not retained.
내가이 일을하는 과정에 필요한 방법을 가지고 할 모든 것이 완벽하게 작동, 모든 유형의 어떠한 경고도 없다가, 이유는 일?. 나는이 프로토콜을 선언했다는 것을 알고있는 UITableViewController
을 상속 받고 있지 않다. 이것은 단지 UIViewController
서브 클래스이다.
편집 : 분명히 거기에 설정된 경우 IB는 경고 메시지를 표시하지 않지만 코드에서 예상대로 작동합니다. 나는 IB가 당신에게 경고를 주어야한다고 생각하지만 나는 그렇지 않다고 생각합니다.
코드에서 시도 할 때 예상대로 경고를 표시하지만 IB에서 수행 할 때 아무 것도 표시하지 않으면 IB에 경고가 표시되어야한다고 생각합니다. –
@OscarGomez 동의합니다. IB에 경고가 표시됩니다. – jbat100