2011-04-05 22 views
9

Cómo generar código QR desde iPhone con protección con contraseña? Debería generar código QR para la imagen dada con protección de contraseña. Cuando leerlo desde el iPhone¿Cómo generar código QR en iPhone?

+1

Utilice el módulo de iPhone [zxing] (http://code.google.com/p/zxing/). –

+0

¿Qué quiere decir con protección con contraseña? – ceejayoz

Respuesta

6

He encontrado una forma muy simple de cómo generar código QR con Google Api. Simplemente tome 1 UIWebView en su código. He tomado IBOutlet UIWebView * webView; y quiero agregar esta gran cantidad de información en mi código QR. 1.Business Nombre 2.First Nombre y Apellido Dirección 3.Physical y el teléfono 4.Website

NSString *url=[NSString stringWithFormat:@"http://chart.apis.google.com/chart?cht=qr&chs=200x200&chl=MECARD:ORG%@CN%@%@CTEL%@CADR%@%@%@%@%@CEMAIL%@",[d valueForKey:@"QR Business Name"],[d valueForKey:@"QR First Name"],[d valueForKey:@"QR Last Name"],[d valueForKey:@"QR Phone"],[d valueForKey:@"QR Physical Address"],[d valueForKey:@"QR Physical City"],[d valueForKey:@"QR Physical State"],[d valueForKey:@"QR Physical Zip"],[d valueForKey:@"QR Physical Zip Plus 4"],[d valueForKey:@"QR Website"]]; 

url=[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 

//Create a URL object. 
NSURL *Curl=[NSURL URLWithString:url]; 
//URL Requst Object 
NSURLRequest *request = [NSURLRequest requestWithURL:Curl]; 
//Load the request in the UIWebView. 
[webView loadRequest:request]; 
21

Ahora con iOS 7 se puede hacer directamente sin bibliotecas adicionales. Hay un ejemplo excelente en https://github.com/shu223/iOS7-Sampler

+0

¡Eso es muy bueno! ¡Gracias! Es muy fácil usar 'CIFilter' para generar códigos QR :) –