【发布时间】:2011-09-20 07:39:19
【问题描述】:
我需要一些帮助。在我的 Iphone App 中,我做了这样的事情: .
我是这样做的:
在头文件中
@interface RecherchePartenaireViewController : UIViewController <UINavigationControllerDelegate>
{
UINavigationController *navigationController;
UITableView *tableViewRecherchePartenaire;
RecherchePartenaireTypePartenaireViewController *recherchePartenaireTypePartenaireViewController;
RecherchePartenaireDistanceViewController *recherchePartenaireDistanceViewController;
}
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@property (nonatomic, retain) IBOutlet UITableView *tableViewRecherchePartenaire;
@property (nonatomic, retain) IBOutlet RecherchePartenaireTypePartenaireViewController *recherchePartenaireTypePartenaireViewController;
@property (nonatomic, retain) IBOutlet RecherchePartenaireDistanceViewController *recherchePartenaireDistanceViewController;
@end
在实现文件中
- (void)viewDidLoad
{
listData = [[NSMutableArray alloc] initWithObjects:@"Type de Partenaire", @"Code postal", @"Ville",@"Distance",@"Nom du Partenaire",@"Audi R8 uniquement",nil];
NSLog(@"hey %@",listData);
tableViewRecherchePartenaire.backgroundColor = [UIColor clearColor];
navigationController=[[UINavigationController alloc] init];
CGRect newRect = navigationController.view.frame;
newRect.size.height -= [UIScreen mainScreen].applicationFrame.origin.y;
[navigationController.view setFrame:newRect];
[navigationController setNavigationBarHidden:YES];
[super viewDidLoad];
}
选择表的第三行时,我这样做:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row==3){
NSLog(@"RecherchePartenaireDistanceViewController...");
recherchePartenaireDistanceViewController = [[RecherchePartenaireDistanceViewController alloc] init];
recherchePartenaireDistanceViewController.recherchePartenaireViewController=self;
[self.navigationController pushViewController:recherchePartenaireDistanceViewController animated:YES];
}
}
请告诉我哪里出错了,因为这似乎不起作用。谢谢。
【问题讨论】:
-
我没有在父对象中看到导航控制器...
-
如果我把这个:[self.view addSubview:navigationController.view];在 viewDidLoad 中,tableview 未选中...在 tableview 上我有一些要更改的文本字段,并且使用此行,键盘没有出现...那么,我该怎么办?
-
可以这样推送:
[self presentModalViewController: recherchePartenaireDistanceViewController animated:YES]; -
我这样视图是从下往上看的。 ..我希望视图从右到左显示,而不是从下到上..我该怎么做?
-
检查
UIModalTransitionStyle modalTransitionStyle...但是没有这种风格。
标签: iphone xcode uitableview uinavigationcontroller