Previously, I was trying to go to another controller using the following code but failed
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
RowDetail *rd = [[RowDetail alloc]initWithNibName:@"RowDetail" bundle:nil];
if ([[allRow objectAtIndex:indexPath.row] is Equal:@"One"])
{
[rd setTitle:[allRow objectAtIndex:indexPath.row]];
}
[self.navigationalController pushViewController:rd animated:NO];
}
I am using a storyboard so I found the other code worked for me but I could not set the title for the controller I was pushing.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryBoard" bundle:nil];
RowDetail *rd = [sb instantiateViewControllerWithIdentifier:@"RowDetail"];
if ([[allRow objectAtIndex:indexPath.row] is Equal:@"One"])
{
[rd setTitle:[allRow objectAtIndex:indexPath.row]];
}
[self.navigationalController pushViewController:rd animated:NO];
}
It worked and showed the RowDetail controller but I could not edit the title. Any idea how can this be done?
EDIT: RowDetail.h
#import <UIKit/UIKit.h>
@interface LecturerDetail : UIViewController
@property (weak, nonatomic) IBOutlet UINavigationBar *rowNavBar;
@property (nonatomic, strong) NSString *lecDetailTitle;
@end
For the RowDetail, I tried using IBOutlet for the navigation bar but failed. I am still trying ways to let the title to show.