点击TabBarItem 后,如果UINavigationControllerstack里面有多个viewcontroller
这个时候确省是popViewControllerAnimated 

客户项目需求点击后要求显示一些分类的button,实现如下
重写 UITabBarController  delegate下面的这个方法 

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController

{

//NSLog(@"goodto see it");

if (self.selectedViewController == viewController ) {

if([((UINavigationController*)viewController).visibleViewController  respondsToSelector:@selector(showCategoryBtns)]){

[(TableViewController*)(((UINavigationController*)viewController).visibleViewController) showCategoryBtns];

}

}

return YES;

}

When you push or pop a view controller on/off a navigaction controller'sstack, the usual viewWillAppear / viewDidAppear methods aren't called. If youwant to ensure they're always called, just add theUINavigationControllerDelegate protocol to your root view controller:

@interface RootViewController : UIViewController { UINavigationController *navController;}

Then implement these two methods:

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{ [viewController viewWillAppear:animated];}- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{ [viewController viewDidAppear:animated];}

Be sure to set the root view controller as the delegate for the navcontroller. Now viewWillAppear / viewDidAppear will be called whenever acontroller is pushed/popped from the stack.

If you want to call the viewWillDisappear/viewDidDisappear methods, your viewcontroller still has to do that manually before popping itself off the navstack.

@implementation UINavigationBar (CustomHeight)

- (void)layoutSubviews {
  [super layoutSubviews];
  CGRect barFrame = self.frame;
  barFrame.size.height = height;
  self.frame = barFrame;
}

@end

http://stackoverflow.com/questions/2133257/iphone-how-set-uinavigationbar-height

http://blog.sina.com.cn/s/blog_93f39bc20100wa8d.html


下拉刷新http://stackoverflow.com/questions/6355918/updating-table-with-egotableviewpullrefresh

支持上拉和下拉刷新http://hi.baidu.com/watsy/blog/item/16e04708829d6e880b7b82ff.html

10-14 05:41