UINavigationController*firstnv = [[UINavigationController alloc] initWithRootViewController:first];
first.navigationItem.title = @"first";
UINavigationController*secondnv = [[UINavigationController alloc] initWithRootViewController:second];
second.title = @"second";
UINavigationController*thirdnv = [[UINavigationController alloc] initWithRootViewController:third];
third.title = @"third";
UINavigationController*fournv = [[UINavigationController alloc] initWithRootViewController:four];
fournv.navigationItem.title = @"four";
主要是因为;虽然生成了多个navigationcontroller,但是他们的bar是公用的,设置bar上title的时候,不能通过navigationbar来设置,要通过navigationcontroller管理的viewcontroller来访问.如:
viewcontroller.navigationbaritem.title来访问;
而且,如果同时存在tabbar;
可以直接.title来设置