4 개의 항목이있는 TabBarController가있는 응용 프로그램을 만들려고합니다. 첫 번째 항목을 선택하면 UITableView가있는보기가 표시됩니다. 이 TableView는 여러 항목으로 채워져 있습니다.UITabBarController의 다중 뷰
내가 무엇을하고 싶은지 : 그 UITableView 밖으로 항목이 선택되면 다른보기가 나타나야합니다; 세부 사항.
하는 .m 이것은 내가 지금까지 무엇을 가지고 .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
- (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];
}
}
.
불행히도 .. 코드가 실행되고 두 번째보기가 표시되지 않습니다.