1
didSelectRowAtIndexPath에 문제가 있습니다.이 지점에 다른 쿼리가 있지만 아무 것도 내 문제를 해결하지 못하는 것 같습니다. 기본적으로 테이블 뷰가로드되지만 셀을 클릭하면 아무 것도하지 않습니다. 즉, 새 xib를 누르지 마십시오. 어떤 도움이라도 좋을 것입니다.didSelectRowAtIndexPath가 새보기를 푸시하지 않음
@implementation ViewController
@synthesize TableViewControl;
@synthesize tableList;
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"The Bird Watching App";
// Do any additional setup after loading the view, typically from a nib.
tableList = [[NSMutableArray alloc] initWithObjects:@"Map",@"My Profile",@"Bird Info", nil];
TableViewControl.dataSource = self;
TableViewControl.delegate = self;
}
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if ([[ tableList objectAtIndex:indexPath.row] isEqual:@"Map"])
{
Map *map = [[Map alloc] initWithNibName:@"Map" bundle:nil];
[self.navigationController pushViewController:map animated:YES];
}
else if ([[ tableList objectAtIndex:indexPath.row] isEqual:@"My Profile"])
{
MyProfile *myprofile = [[MyProfile alloc] initWithNibName:@"My Profile" bundle:nil];
[self.navigationController pushViewController:myprofile animated:YES];
}
else if ([[ tableList objectAtIndex:indexPath.row] isEqual:@"Bird Info"])
{
BirdInfo *birdinfo = [[BirdInfo alloc] initWithNibName:@"Bird Info" bundle:nil];
[self.navigationController pushViewController:birdinfo animated:YES];
}
}
@end
답장을 보내 주셔서 감사합니다. 그냥 시도했지만 여전히 동일한 문제 : ( – Lateralus
'self.navigationController'가 nil이 아님을 확인할 수 있습니까? –
게시 한 내용을 복사하여 모든 self.navigationController 다음에 pushViewController가옵니다. – Lateralus