iOS SSO,从weibo返回 自己的app 时,如何弹出一个UIViewController~
高洛峰
高洛峰 2017-04-17 14:31:53
0
2
272

流程是这样的 从第三方应用的使用微博登录页面(#view.1);
--->跳转weibo.app 的第三方应用授权页面,点击授权后;
---->返回第三方应用(先载入第三方应用的启动图),然后载入#view.1;
----->这时候我需要弹出一个pop-up view(继承自UIViewController);
问题就出在这个启动图这里。我的pop-up 控件执行了没反应(我猜想是因为当时程序在启动页面导致的)。
但是微博的demo里面用[UIAlertView show]是可以弹出的UIAlertView的。
我需要怎么做才能弹出pop-up 呢~

微博回调代码

appdelegete.m
- (void)didReceiveWeiboResponse:(WBBaseResponse *)response
{UIAlertView *alert = XXXXXXXXXXX;
 [alert show];}
    //可以弹出 alerview;
 [[[pop-up alloc]init] presentFromViewController];
    //没有反应;

我的pop-up(继承自UIViewController) 弹出代码


- (void)presentFromViewController: { _rootViewController=[UIApplication sharedApplication].delegate.window.rootViewController; //这个也试过了 不行[UIApplication sharedApplication].keyWindow.rootViewController; [controller addChildViewController:self]; [controller.view addSubview:self.view]; [self didMoveToParentViewController:controller]; }
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

répondre à tous(2)
洪涛
[self presentViewController:yourController animated:YES completion:nil];
刘奇

UIAlertView是UIWindow 你用UIWindow试试看 应该可以

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!