Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在现有项目中添加导航栏_Iphone_Integration_Uinavigationbar - Fatal编程技术网

Iphone 在现有项目中添加导航栏

Iphone 在现有项目中添加导航栏,iphone,integration,uinavigationbar,Iphone,Integration,Uinavigationbar,我有三个viewController v1 v2 v3,从v1到v2我使用导航控制器的pushViewController属性,但从v2到v3我使用presentviewController。在v3中,我需要右侧带有按钮的导航栏,以便执行该方法。 请参阅帮助。在您的view controller V2中,使用以下代码展示您的V3 V3 *obj_V3=[[V3 alloc]initWithNibName:@"V3" bundle:nil]; UINavigationController *nav

我有三个viewController v1 v2 v3,从v1到v2我使用导航控制器的pushViewController属性,但从v2到v3我使用presentviewController。在v3中,我需要右侧带有按钮的导航栏,以便执行该方法。
请参阅帮助。

在您的view controller V2中,使用以下代码展示您的V3

V3 *obj_V3=[[V3 alloc]initWithNibName:@"V3" bundle:nil];
UINavigationController *navBar=[[UINavigationController alloc]initWithRootViewController:obj_V3];
[self.navigationController presentModalViewController:navBar animated:YES];
[navBar release];
[obj_V3 release];
在你的V3中添加

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(performMethod)] autorelease];
还有你的表演方法

-(void)performMethod {
//your code
}

然后创建一个自定义导航栏。如果没有自定义过程,这是不可能的,然后在v3中执行自定义过程。谢谢crimeMaster Gogogo,你已经完成了我的代码犯罪,并提供了惊人的解决方案