Hi again,
Ok, I have a new issue when I try to add a additional tableView to a new view.
The set up I have is as follows :
TabBarController
-NavagationController
-ViewController
No each of the tab bar items has a navagationController and the first nib to load is a Content Page (UITableView) once the user selects an item he/she is directed to the relevant page.
I have successfully created a contents page for the first item in the tab bar.
However once I attempt to create the UITableView for the second item and run the app I get the following error in the console:
-[UIViewController tableView:numberOfRowsInSection:]: unrecogised selector sent to instance 0x5a28770
Now heres the code:
.h
Code:
#import <UIKit/UIKit.h>
@interface Contents : UIViewController <UITableViewDataSource, UITableViewDelegate> {
NSString * item;
NSMutableArray *ContentsList;
}
@property (nonatomic, retain) NSString *item;
@property (nonatomic, retain) NSMutableArray *ContentsList;
@end
.m
Code:
#import "Contents.h"
@implementation Contents
@synthesize ContentsList;
@synthesize item;
- (void)viewDidLoad
{
[super viewDidLoad];
ContentsList = [[NSMutableArray alloc]initWithObjects:
@"Content Item One",
@"Content Item Two",
@"Content Item Three",
@"Content Item Four",
nil];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [ContentsList count];
}