In this one, when I change the masterview controller ( On the left) tab, I want to update the value in the tableview on the right. This would be a good way, should I load another viewcontroller for each tab change? is it possible? Or just update the table? For all tab changes, I want to display a tableview with different data.
I use the code below and I can see the changes in the log, but the table is not updated.
- (void)setDetailItem:(id)newDetailItem
{
if (_detailItem != newDetailItem) {
[_detailItem release];
_detailItem = [newDetailItem retain];
// Update the view.
[self configureView];
}
if (self.masterPopoverController != nil) {
[self.masterPopoverController dismissPopoverAnimated:YES];
}
}
- (void)configureView
{
// Update the user interface for the detail item.
if (isStudent) {
textStr = @"student";
NSLog(@"Student....%@",textStr);
[self.tableView reloadData];
}if (isTeachers) {
textStr = @"teacher";
NSLog(@"Teacher....%@",textStr);
[self.tableView reloadData];
}if (isPreference) {
textStr = @"preference";
NSLog(@ "Preference....%@",textStr);
[self.tableView reloadData];
}if (isConfiguration) {
textStr = @"configuration";< br /> NSLog(@"Configuration....%@",textStr);
[self.tableView reloadData];
}
}
I tried it too
[self performSelectorOnMainThread:@selector(refreshTableView) withObject:nil waitUntilDone:NO];
Please share your thoughts.
Thanks:)
Thank you:)
I am creating an iPad application with splitview, this Is the screenshot,
In this one, when I change the tab in the masterview controller (left), I want to update the value in the tableview on the right. It will be a very Good way, should I load another viewcontroller for each label change? is it possible? Or just update the table? For all tab changes, I want to display a tableview with different data.
I use the code below and I can see the changes in the log, but the table is not updated.
- (void)setDetailItem:(id)newDetailItem
{
if (_detailItem != newDetailItem) {
[_detailItem release];
_detailItem = [newDetailItem retain];
// Update the view.
[self configureView];
}
if (self.masterPopoverController != nil) {
[self.masterPopoverController dismissPopoverAnimated:YES];
}
}
- (void)configureView
{
// Update the user interface for the detail item.
if (isStudent) {
textStr = @"student";
NSLog(@"Student....%@",textStr);
[self.tableView reloadData];
}if (isTeachers) {
textStr = @"teacher";
NSLog(@"Teacher....%@",textStr);
[self.tableView reloadData];
}if (isPreference) {
textStr = @"preference";
NSLog(@"P reference....%@",textStr);
[self.tableView reloadData];
}if (isConfiguration) {
textStr = @"configuration";
NSLog(@"Configuration....%@",textStr);
[self.tableView reloadData];
}
}
I also tried it
[self performSelectorOnMainThread:@selector(refreshTableView) withObject:nil waitUntilDone:NO];
Please share your thoughts.< br>Thanks:)
Finally I found this problem myself, I am really happy to find a solution. I have browsed several forums and tutorials. Finally I figured out the problem. In this video, they have explained how to create a SplitView application with XCode 4.2. In this article, only one line of code solves this problem. That is in the Appdelegate.m file. Default In this case, the MasterViewController does not have access to the detail view, so if we need to perform some operations on the detailview, we must connect the masterviewcontroller and the detailviewcontroller. Check the video, and then you (those who face the same problem) will understand.
< /p>
Thank you:)