我想重新加載包含在tabbar控制器(UIViewController)中的所有視圖。搜索後,我發現我必須應用setNeedsDisplay方法,但我無法獲得應該在哪裏應用它。所有其他替代方法也歡迎如何重新加載UIViewController
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
.....
.....
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
[self customToolbar];
[self.window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
return YES;
}
-(void)customToolbar
{
//Declared view controllers and their Navigation Controller
.....
//Declared tab bar items
.....
tabBarController = [[GTabBar alloc] initWithTabViewControllers:viewControllersArray tabItems:tabItemsArray initialTab:1];
}
當你想重新加載/刷新你的VC? – Maulik
我在另一個NSObject類中調用應用程序委託,我在其中放置了一些按鈕動作。當按鈕被按下時,我想重新加載VC的 –