好的,所以我有一部分应用程序正在处理视图之间的浮点变量传递,一切都很好,但是所有的按钮看起来有点乱。并且这样我就快完成了,我想看看是否可以在现有视图中添加一个 tabBar 并清理它。我找到了一个很棒的教程,并让它链接起来并报告我在 NSLog 中选择的选项卡,所以继续粘贴我用于相同功能的按钮的代码。一切都变得有点好笑,我不得不做一些新的变量,我遇到了最后一个我无法弄清楚的错误。这是我第一次调用 patternRafter 时需要一个预期的表达式
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item {
NSLog(@"didSelectItem: %d", item.tag);
[self activateTab:item.tag];
}
- (void)activateTab:(int)index {
switch (index) {
case 1:
patternRafter *patternRafter1 = [[patternRafter alloc]initWithNibName:nil bundle:nil];
BuildNavAppDelegate *buildNavDelegate = (BuildNavAppDelegate *)[[UIApplication sharedApplication]delegate];
buildNavDelegate.TLPMR = [TLMR text];
buildNavDelegate.comRaftBirdPassed = [comBird text];
buildNavDelegate.comRaftLengthPassed = [comRafter text];
buildNavDelegate.raftThicknessPassed = [rafterWidth text];
[self presentModalViewController:patternRafter1 animated:YES];
break;
/*case 2:
buildersSquare *square1 = [[buildersSquare alloc]initWithNibName:nil bundle:nil];
BuildNavAppDelegate *buildNavDelegate = (BuildNavAppDelegate *)[[UIApplication sharedApplication]delegate];
buildNavDelegate.TLPMR = [TLMR text];
buildNavDelegate.comRaftBirdPassed = [comBird text];
buildNavDelegate.comRaftLengthPassed = [comRafter text];
buildNavDelegate.raftThicknessPassed = [rafterWidth text];
[self presentModalViewController:square1 animated:YES];
break;
case 3:
self.tab2ViewController =[[tab2 alloc] initWithNibName:@"tab2" bundle:nil];
[self.view insertSubview:tab2ViewController.view belowSubview:tabbar1];
if (currentViewController != nil)
[currentViewController.view removeFromSuperview];
currentViewController = tab2ViewController;
break;*/
default:
break;
}
}
任何帮助,将不胜感激。谢谢,我刚刚意识到我不能发布图片,因为我还是一个新用户。所以如果有人想检查一下,这里有一个链接。 http://dl.dropbox.com/u/72193343/Screen%20shot%202012-05-18%20at%209.22.48%20AM.png