一,代码动态改写
1,一般程序启动就自动执行 main.storyboard
也可以在AppDelegate改写
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
//使用Storyboard初始化根界面
// UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
// self.window.rootViewController = [storyBoard instantiateInitialViewController];
2,xib里调用storyboard
- (IBAction)loginBtnClicked:(id)sender {
//点击登陆按钮后切换到storyboard界面
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
// self.view.window.rootViewController = [storyboard instantiateInitialViewController];
// [self PResentModalViewController:[storyboard instantiateInitialViewController] animated:YES];
[self presentViewController:[storyboard instantiateInitialViewController] animated:YES completion:nil];
[storyboard release];
}
3,storyboard调用storyboard
4.
push segue
是将另一个视图控制器压入到导航控制器的栈中。它通常和导航视图控制器(navigation view controller)一起使用。
新压入的视图控制器会有一个回退按钮,可以退回来上一层
modal segue
跳转到vc
http://luckfox.VEvb.com/blog/1826416
custom自定义,很少用
参考:
http://iaiai.VEvb.com/blog/1493956 可惜实例无法下载
仅用于uitableviewcontroller,不可以用在tableview!!!
列子:http://my.oschina.net/plumsoft/blog/53886(包含kvc(实现类似代理的父子画面调用))
代码名:
新闻热点
疑难解答