(Yay. More newbishness.)
Okay so, after the headaches of running around trying to stuff square pegs into round holes, i downloaded one of Apple's sample codes (MultipleDetailViews) and started jamming my stuff into their templates instead.
I've run into a slight issue though.
RootViewController is handling the item selection, as it should, and is doing it in this manner:
Which works fine.
But; I need to put information into the textarea (UITextView *textarea) of the FirstDetailViewController instance, based on the curfile variable.
I tried detailViewController.textarea.text = @"Some text", but was told that I couldnt do that 'in something not a structure or union'. Whatever that means.
FirstDetailViewController obviously doesnt have access to the curfile variable at runtime, and has no way of knowing which item was selected from the menu.
What am I missing here?
Okay so, after the headaches of running around trying to stuff square pegs into round holes, i downloaded one of Apple's sample codes (MultipleDetailViews) and started jamming my stuff into their templates instead.
I've run into a slight issue though.
RootViewController is handling the item selection, as it should, and is doing it in this manner:
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
/*
Create and configure a new detail view controller appropriate for the selection.
*/
curfile = [[[indexItems objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] objectForKey:@"filename"];
UIViewController <SubstitutableDetailViewController> *detailViewController = nil;
if (curfile != @"Calculator") {
FirstDetailViewController *newDetailViewController = [[FirstDetailViewController alloc] initWithNibName:@"FirstDetailView" bundle:nil];
detailViewController = newDetailViewController;
} else {
SecondDetailViewController *newDetailViewController = [[SecondDetailViewController alloc] initWithNibName:@"SecondDetailView" bundle:nil];
detailViewController = newDetailViewController;
}
// Update the split view controller's view controllers array.
NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
splitViewController.viewControllers = viewControllers;
[viewControllers release];
// Dismiss the popover if it's present.
if (popoverController != nil) {
[popoverController dismissPopoverAnimated:YES];
}
// Configure the new view controller's popover button (after the view has been displayed and its toolbar/navigation bar has been created).
if (rootPopoverButtonItem != nil) {
[detailViewController showRootPopoverButtonItem:self.rootPopoverButtonItem];
}
[detailViewController release];
}
But; I need to put information into the textarea (UITextView *textarea) of the FirstDetailViewController instance, based on the curfile variable.
I tried detailViewController.textarea.text = @"Some text", but was told that I couldnt do that 'in something not a structure or union'. Whatever that means.
FirstDetailViewController obviously doesnt have access to the curfile variable at runtime, and has no way of knowing which item was selected from the menu.
What am I missing here?