Hi there,
I've tried to ask this before, but nothing got answered. Basically, I would like someone to explain to me how to create a table, which when a cell is tapped, pushes the user to the next view for that cell. I have this so far:
Click here to view what I have.
I would further like to, say when CSS is tapped, it goes to a new view which has another table in it. This table would then take the user to a detail view, which is scrollable and you can switch pages through it.
I would appreciate longer, more structured tutorials on how to do each and every bit to get it to work.
Here's my array in my implementation file:
- (void)viewDidLoad {
arryClientSide = [[NSArray alloc] initWithObjects:@"CSS", @"HTML", @"JavaScript", @"XML", nil];
arryServerSide = [[NSArray alloc] initWithObjects:@"Apache", @"PHP", @"SQL", nil];
self.title = @"Select a Language";
[super viewDidLoad];
}
and my .h:
@interface RootViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> {
IBOutlet UITableView *tblSimpleTable;
NSArray *arryClientSide;
NSArray *arryServerSide;
}
My current code crashes the script, and this error is returned in the console:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "NextView" nib but didn't get a UITableView.'
If that error is the source of why it's not pushing, then an explanation of how to remedy that would also be appreciated
NextViewController implementation
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
arryBasicCSS = [[NSArray alloc] initWithObjects:@"Implement", @"Syntax", @"Classes and IDs", @"Fonts", @"Backgrounds", @"Lists", @"Links", nil];
arryIntermediateCSS = [[NSArray alloc] initWithObjects:@"Padding and Margin", @"Alignment and Floating", @"Pseudo-class and Element", @"Opacity and Display", nil];
arryAdvancedCSS = [[NSArray alloc] initWithObjects:@"Sprites", @"Attribute Selectors", @"Animation", nil];
self.title = @"CSS";
[super viewDidLoad];
}
- (IBAction) changeItemTable:(NSString *)str{
tblCSS = str;
}
NextViewController.h
@interface NextViewController : UITableViewController {
IBOutlet UITableView *tblCSS;
NSArray *arryBasicCSS;
NSArray *arryIntermediateCSS;
NSArray *arryAdvancedCSS;
}
Many thanks, Jack