1、新建项目“AliDemo”
2、引入sdk、资源文件、openssl、util、order文件
3、引入系统框架
4、在触发事件中写入代码,如ViewController.m按钮的点击事件- (IBAction)payBtnClick:(id)sender {}
5、注册Schemes,加入白名单,Info --> URL Types
6、运行发现剩余问题
6.1 Cannot find interface declaration for 'NSObject', superclass of 'Base64'
创建pct文件-->引入<Foundation/Foundation.h>-->Build Settings-->搜索prefix -->Prefix Header --> 输入$(SRCROOT)/项目名/.pch文件名
6.2 'openssl/asn1.h' file not found
Build Setting --> Search Path --> Header Search Paths --> 输入openssl文件的上一级路径
6.3 "_BIO_free_all", referenced from:
"_BIO_new", referenced from:
"_BIO_s_file", referenced from:
如果出现6.3错误,是因为第二步忘了导入.a文件
6.4 base64.h和base64.m出错,建立pct文件,引入Foundation系统框架.
网友评论