ControllerからDataSourceを切り離す

  1. データソースクラスのヘッダーにUIKitインポート
#import <UIKit/UIKit.h>
  1. データソースクラスのヘッダーにUITableViewDataSource準拠の宣言
@interface TableDataProvider : NSObject<UITableViewDataSource>
  1. ViewControllerクラスでデータソースクラスのインスタンスをプロパティで保持
@property(strong, nonatomic) TableDataProvider *dataSource;
  1. ViewControllerのviewDidLoadなどに以下を記載(ViewControllerのtableviewのデータソースにTableDataProviderのインスタンスを指定)
self.dataSource = [[TableDataProvider alloc]init];
self.tableView.dataSource = self.dataSource;

以上