@@ -70,12 +70,12 @@ - (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
7070 }
7171}
7272
73- - (instancetype )initWithEventDispatcher : (RCTEventDispatcher *)eventDispatcher bridge : (RCTBridge*) bridge
73+ - (instancetype )initWithEventDispatcher : (RCTEventDispatcher *)eventDispatcher
7474{
7575 RCTAssertParam (eventDispatcher);
7676
7777 if ((self = [super initWithFrame: CGRectZero])) {
78- _bridge = [[RNAppGlobals sharedInstance ] appBridge ] ?: bridge ;
78+ _bridge = [[RNAppGlobals sharedInstance ] appBridge ];
7979 _eventDispatcher = eventDispatcher;
8080 _cellHeight = 44 ;
8181 _cells = [NSMutableArray array ];
@@ -286,7 +286,6 @@ - (void)setSections:(NSArray *)sections
286286 if (selectedIndex == -1 )
287287 selectedIndex = [items count ];
288288 itemData[@" selected" ] = @YES ;
289-
290289 found = YES ;
291290 }
292291 [items addObject: itemData];
@@ -322,6 +321,9 @@ -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)
322321}
323322
324323-(UITableViewCell*)setupReactModuleCell : (UITableView *)tableView data : (NSDictionary *)data indexPath : (NSIndexPath *)indexPath {
324+ RCTAssert (_bridge, @" Must set global bridge in AppDelegate, e.g. \n \
325+ #import <RNTableView/RNAppGlobals.h>\n \
326+ [[RNAppGlobals sharedInstance] setAppBridge:rootView.bridge]" );
325327 RNReactModuleCell *cell = [tableView dequeueReusableCellWithIdentifier: _reactModuleCellReuseIndentifier];
326328 if (cell == nil ) {
327329 cell = [[RNReactModuleCell alloc ] initWithStyle: self .tableViewCellStyle reuseIdentifier: _reactModuleCellReuseIndentifier bridge: _bridge data: data indexPath: indexPath reactModule: _reactModuleForCell];
0 commit comments