Uinavigationcontroller 为iphone中的不同视图控制器设置不同导航栏标题

Uinavigationcontroller 为iphone中的不同视图控制器设置不同导航栏标题,uinavigationcontroller,uinavigationbar,title,Uinavigationcontroller,Uinavigationbar,Title,我有导航栏我正在设置导航栏中使用的图像标题,它工作正常,但当我为其他控制器使用相同的代码时,它会在导航栏上显示相同的先前标题,而不是新标题 这是密码 UIImage *image = [UIImage imageNamed:@"Nav.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; [self.navigationController.navigationBar addSubview:im

我有导航栏我正在设置导航栏中使用的图像标题,它工作正常,但当我为其他控制器使用相同的代码时,它会在导航栏上显示相同的先前标题,而不是新标题

这是密码

   UIImage *image = [UIImage imageNamed:@"Nav.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[self.navigationController.navigationBar addSubview:imageView]; 




titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(50,2,250,36)];
titleLabel.text=@"Activity";
titleLabel.textColor=[UIColor whiteColor];
titleLabel.backgroundColor=[UIColor clearColor];
titleLabel.font=[UIFont fontWithName:@"Helvetica-Bold" size :18];
[self.navigationController.navigationBar addSubview:titleLabel];