zoukankan      html  css  js  c++  java
  • iOS alipay sdk(支付宝) web(wap/网页)回调黑屏,不完美解决方案

    不完美解决方案...(黑屏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];

  • 相关阅读:
    正则表达式的单行模式和多行模式
    js 正则匹配(去掉html标签)
    ES6中set和map的区别
    回调函数的使用场合
    javascript逻辑运算符“||”和“&&”
    [bzoj3210]花神的浇花集会
    [bzoj2438][中山市选2011]杀人游戏
    [bzoj2743][HEOI2012]采花
    [luoguP3729]曼哈顿计划EX
    [bzoj4850][Jsoi2016]灯塔
  • 原文地址:https://www.cnblogs.com/Leetvin/p/3932865.html
Copyright © 2011-2022 走看看