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