首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

两个UIVIEW之间的切换的有关问题?在线请问!

2012-05-05 
两个UIVIEW之间的切换的问题?在线请教!!!!!testViewController是继承UIViewController,而下面的代码是继承

两个UIVIEW之间的切换的问题?在线请教!!!!!
testViewController是继承UIViewController,而下面的代码是继承在UIVIEW类里,而不是继承UIVIEWCONTRLLER.但是下面的代码一但执行到 [self presentModalViewController:_setViewController animated:YES];就会出错。请问怎么样才可以切换到另外一个UIVIEWController里。急着请教!!!!!!!

  testViewController *_setViewController = [[testViewController alloc]init];
  [self presentModalViewController:_setViewController animated:YES];
  [_setViewController release];
  [self dismissModalViewControllerAnimated:YES];

[解决办法]
既然的的代码是在继承uiview的类中,当然就没有presentModalViewController方法啦

所以需要在你的view中加入一个delegate,将delegate指向你的viewcontroller(必须继承uiviewcontroller),然后[delegate presentModalViewController:_setViewController animated:YES];这样才可以
[解决办法]
切换到另外一个UIVIEWController里 ?
你是想取到Controller的话 传值就可以了,简单的就是写个方法把指针附过去

热点排行