您的位置:首页 > 其它

页面间跳转和传值

2013-03-20 10:10 225 查看
1.先修改appdelegate

self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.
    FirstViewController *rootView=[[[FirstViewController alloc]init]autorelease];
    self.navController=[[[UINavigationController alloc]init]autorelease];
    [self.navController pushViewController:rootView animated:YES];
    [self.window addSubview:self.navController.view];
    [self.window makeKeyAndVisible];


然后传值和跳转:

SecondViewController *SecondView= [[[SecondViewController alloc] init]autorelease];
    SecondView.str=_tf01.text;
    [self.navigationController pushViewController:SecondView animated:YES];


返回

[self.navigationController popViewControllerAnimated:YES];
效果图:





源码下载:下载
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: