码迷,mamicode.com
首页 > 移动开发 > 详细

iOS alipay sdk(支付宝) web(wap/网页)回调黑屏,不完美解决方案

时间:2014-08-24 16:38:12      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:blog   http   os   io   strong   for   ar   html   log   

不完美解决方案...(黑屏1秒恢复...)

 原创保留:http://www.cnblogs.com/Leetvin/p/3932865.html

原因:wap回调 如果加入UINavigationController就会黑屏
#if ! __has_feature(objc_arc)
    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
#else
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
#endif
    
    self.nav=[[UINavigationController alloc]initWithRootViewController:self.viewController];
    
    [self.window addSubview:self.nav.view];

1.在AppDelegate添加一个公用方法test
AppDelegate.m

-(void)test
{
    [self performSelector:@selector(test2) withObject:nil afterDelay:1];
    [self.window addSubview:self.nav.view];
}
-(void)test2
{
    [self.window addSubview:self.nav.view];
}

2.回调wap那边添加一下调用AppDelegate的方法

//wap回调函数

-(void)paymentResult:(NSString *)resultd

...


        else
        {
            //交易失败
        }
    }
    else
    {
        //失败
    }
    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    [appDelegate test];

iOS alipay sdk(支付宝) web(wap/网页)回调黑屏,不完美解决方案

标签:blog   http   os   io   strong   for   ar   html   log   

原文地址:http://www.cnblogs.com/Leetvin/p/3932865.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!