Warning: control reaches end of non-void function - iPhone

前端 未结 2 1892
渐次进展
渐次进展 2020-11-29 08:30

I keep getting \'warning: control reaches end of non-void function\' with this code:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(N         


        
2条回答
  •  清歌不尽
    2020-11-29 09:29

    One option:

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
        if (section ==0) {
            return [comparativeList count];
        } else if (section==1) {
            return [generalList count];
        }
        // section == 2    
        return [contactList count];
    }
    

提交回复
热议问题