我有一个非常简单但令人沮丧的问题。在我的didSelectRowAtIndexPath:
方法中,我试图更改UIImageView
另一个视图,但不幸的是,它不起作用,并且UIImageView
保持不变。
我究竟做错了什么?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
MainViewController *demoController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
demoController.title = [NSString stringWithFormat:@"Demo Controller #%d-%d", indexPath.section, indexPath.row];
NSArray *controllers = [NSArray arrayWithObject:demoController];
self.sideMenu.navigationController.viewControllers = controllers;
[self.sideMenu setMenuState:MFSideMenuStateClosed];
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"server"] isEqualToString:@"imap.mail.me.com"]){
if (indexPath.row == 0)
theAppDelegate.folder = @"INBOX";
UIImage *image = [UIImage imageNamed:@"inbox.png"];
demoController.imageBG.image = image;
if (indexPath.row == 1)
theAppDelegate.folder = @"Sent Messages";
UIImage *image2 = [UIImage imageNamed:@"sentmail.png"];
demoController.imageBG.image = image2;
if (indexPath.row == 2)
theAppDelegate.folder = @"Drafts";
UIImage *image3 = [UIImage imageNamed:@"drafts.png"];
demoController.imageBG.image = image3;
if (indexPath.row == 3)
theAppDelegate.folder = @"Deleted Messages";
UIImage *image4 = [UIImage imageNamed:@"trash.png"];
demoController.imageBG.image = image4;
if (indexPath.row == 4)
theAppDelegate.folder = @"Archive";
UIImage *image5 = [UIImage imageNamed:@"archive.png"];
demoController.imageBG.image = image5;
if (indexPath.row == 5)
theAppDelegate.folder = @"Junk";
UIImage *image6 = [UIImage imageNamed:@"junk.png"];
demoController.imageBG.image = image6;
}
}