导入lizbqrencode第三方文件夹
头文件
#import "QRCodeGenerator.h"
{
UIImageView *ima;
}
[super viewDidLoad];
ima=[[UIImageView alloc]initWithFrame:CGRectMake(40, 50, 100, 100)];
[self.view addSubview:ima];
UIButton *bu=[[UIButton alloc]initWithFrame:CGRectMake(120, 240, 100, 44)];
bu.backgroundColor=[UIColor redColor];
[bu setTitle:@"生成" forState:UIControlStateNormal];
[bu addTarget:self action:@selector(fan) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:bu];
}
-(void)fan
{
ima.image = [QRCodeGenerator qrImageForString:@"付洪恩" imageSize:ima.bounds.size.width];
NSString * str;
[[UIApplication sharedApplication] openURL:str];
}