我有一個帶有三個選項卡/視圖控制器的tabbarcontroller。UIActivityIndicatorView無法正常工作(獲取影響UIActivityIndicatorView的Facebook權限)
當我第一次啓動我的應用程序時,我的ActivityIndicator被設置爲可見和動畫 - 由界面構建器提供 - 它工作正常。
但是,當我點擊一個按鈕,一個互聯網窗口打開到Facebook,以獲得用戶的許可。
一旦Facebook部分被照顧後,它會返回到我的應用程序,但ActivityIndicator不再是動畫 - 它仍然可見,但只是凍結。
如果我切換到另一個tab/viewcontroller,然後回到帶有ActivityIndicator的tab/viewcontroller,一切正常。
有沒有辦法刷新我的ViewController,以便我不必以編程方式使ViewController來回切換?還是有其他建議?
/*我搜索了論壇,我看到了類似的問題。看起來有一個斷開的連接。因此,我將包含添加ViewController(即「控制器」到我的tabbarcontroller)的代碼。 */
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
controller = [[DemoAppViewController alloc] init];
controller.view.frame = CGRectMake(0, 20, 320, 460);
controller.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"movieAppBackground.jpg"]];
MyTabBarViewController *vc2 = [[MyTabBarViewController alloc] init];
SecondViewController *vc3 = [[SecondViewController alloc] init];
controller.title = @"Intro Screen";
vc2.title = @"Explore";
vc3.title = @"Send a Pic";
UITabBarController *tbc = [[UITabBarController alloc] init];
tbc.viewControllers = [NSArray arrayWithObjects:controller, vc2, vc3, nil];
self.theTBC=tbc;
[controller release];
[vc2 release];
[vc3 release];
[tbc release];
[self.window addSubview:tbc.view];
[self.window makeKeyAndVisible];
return YES;
}
謝謝@Vijay - 我一定會用initWithNibName :-)來初始化所有三個視圖控制器。但是,我確實嘗試了ViewController,它給了我一些問題,但它仍然沒有幫助。 – NateHill
什麼是你的錯誤日誌帖子在這裏 –
不知道這是檢查錯誤的正確方法,但我做了NSLog(@「%@」,aiView.hidden = NO);'它返回了'(NULL)這與我首先切換製表符時相同(即,當它動畫正確時) – NateHill