I have a weird problem with my TableView which is always set to nil. I'll explain more:
This is my storyboard:
In my BuddyListViewController.m file I instantiate my ChatViewController :
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
userName = (NSString *) [onlineBuddies objectAtIndex:indexPath.row];
JCChatViewController *chatController = [[JCChatViewController alloc] initWithUser:userName];
[self presentViewController:chatController animated:YES completion:nil];
}
ChatViewController (.h) File
@interface JCChatViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
UITextField *messageField;
UITableView *tView;
}
@property (nonatomic,retain) IBOutlet UITextField *messageField;
@property (nonatomic,strong) IBOutlet UITableView *tView;
-(id) initWithUser:(NSString *) userName;
-(IBAction)sendMessage;
@end
I also linked my tableView with my tView property
ChatViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
self.tView.delegate = self;
self.tView.dataSource = self;
[self.tView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
}
While debugging, I always have self.tView equal to nil, with is very bizarre, thus, my TableView Delegate methods are not invoked.
Best regards