0
我正在尝试构建一个应用程序,其中有4个条目的TabBarController。 当我选择第一个条目时,出现带有UITableView的视图。 这个TableView充满了几个条目。UITabBarController的多个视图
我想要做的是: 当一个输入出UITableView被选中时,应该显示另一个视图;详细视图。
.M
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0) {
if(self.secondView == nil) {
SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondView" bundle:[NSBundle mainBundle]];
self.secondView = secondViewController;
[secondViewController release];
}
// Setup the animation
[self.navigationController pushViewController:self.secondView animated:YES];
}
}
.H
#import <UIKit/UIKit.h>
#import "SecondViewController.h"
@interface FirstViewController : UIViewController {
SecondViewController *secondView;
NSMutableArray *myData;
}
@property (nonatomic, retain) SecondViewController *secondView;
@property (nonatomic, copy, readwrite) NSMutableArray* myData;
@end
这是我到目前为止所。
不幸的是..代码运行,第二个视图没有显示出来。