0
当我尝试导入时,它在导入时出现错误,指出“方法定义不在@implementation上下文中”。我认为错误在于以下代码...方法定义不在@implementation上下文中:错误
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSDictionary *infoDictionary = [self.jsonArray objectAtIndex:indexPath.row];
static NSString *Prospects = @"agencyname";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Prospects];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:Prospects] autorelease];
}
// setting the text
cell.text = [infoDictionary objectForKey:@"agencyname"];
// Set up the cell
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ViewAgencyController *dvController = [[ViewAgencyController alloc] initWithNibName:@"ViewAgency" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:dvController animated:YES];
[dvController release];
dvController = nil;
}
无法想象它。
您是否意外地将这些方法定义放在某个类的头文件中,在它的接口中?这些文件在哪里? – 2011-12-26 07:35:51
didSelectRowAtIndexPath是我抛出此错误的唯一修改。我做了#import ViewAgencyController并添加了底部部分 – savagenoob 2011-12-26 07:38:53