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
這是我到目前爲止所。
不幸的是..代碼運行,第二個視圖沒有顯示出來。