解决方法
您可以使用Simon上面发布的第一个链接中的提示来获取委托的方法签名.之后,添加代码取决于您.
我喜欢做的是选择我最常使用的委托方法,以及add them to a code snippet.
例如,对于UITableViewDatasource,我有一个名为“UITableView Datasource required Methods”的代码段,其中包含:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"myCellName"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:cellIdentifier] autorelease]; } //customize cell before showing it return cell; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return <#numRow#> ; }