gpt4 book ai didi

iphone - UIActivityIndi​​catorView 不工作(获取影响 UIActivityIndi​​catorView 的 Facebook 权限)

转载 作者:行者123 更新时间:2023-11-29 05:01:13 24 4
gpt4 key购买 nike

我有一个带有三个选项卡/ View Controller 的选项卡 Controller 。

当我第一次启动我的应用程序时,我的 ActivityIndi​​cator 设置为可见且具有动画效果(由界面生成器提供),它工作正常。

但是,当我单击按钮时,会打开一个访问 Facebook 的互联网窗口以获得用户的许可。

一旦 Facebook 部分得到处理,它就会返回到我的应用程序,但 ActivityIndi​​cator 不再是动画的 - 但它仍然可见,只是卡住了。

如果我切换到另一个选项卡/ View Controller ,然后返回带有 ActivityIndi​​cator 的选项卡/ View Controller ,则一切正常。

有没有办法刷新我的 ViewController,这样我就不必以编程方式来回切换 ViewController?或者还有其他建议吗?

/* 我搜索了论坛,看到了类似的问题。看来连接已断开。因此,我将包含添加 ViewController 的代码(即“ Controller ”到我的选项卡 Controller )。 */

- (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;

}

最佳答案

无论你在哪里使用NIB文件来显示 View Controller ,你都必须使用initwithname创建它们

示例

     SecondViewController *r=[[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];

无论您在哪里使用 nib 文件创建实例,都喜欢这种更改,

我的意思是您使用 NIB 文件创建的所有自定义 View Controller

关于iphone - UIActivityIndi​​catorView 不工作(获取影响 UIActivityIndi​​catorView 的 Facebook 权限),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6900067/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com