You need to log in to create posts and topics.
NSString to Image
1,678 Posts
#1 · September 13, 2012, 1:11 pm
Quote from Forum Archives on September 13, 2012, 1:11 pmPosted by: mactech <mactech@...>
I need some help converting a NSString which represents an Image file sent from an iOS device.The image is the signature for a credit card transaction.I am receiving all of the data as a CFString on the Mac side.How can I convert it to an image that I can use in FB?This is how the data is formatted when sent with other data about the transaction.NSData *sigData = UIImageJPEGRepresentation(delegate.signature, 1.0);NSString *sigDataString = [NSString stringWithFormat:@"%@", sigData];myString = [myString stringByAppendingString:@" Signature :"];myString = [myString stringByAppendingString:sigDataString];myString = [myString stringByAppendingString:lineFeed];
NSLog(@"%@", myString);
NSString *cardDataSend = [NSString stringWithFormat:@"%@rn", myString];NSData *cardData = [cardDataSend dataUsingEncoding:NSUTF8StringEncoding];
[asyncSocket writeData:cardData withTimeout:-1 tag:0]; //write data to serverthanks
Steve
To unsubscribe, e-mail: fbcocoa-unsubscribe@welovegod.org For additional commands, e-mail: fbcocoa-help@freegroups.net
Posted by: mactech <mactech@...>
I need some help converting a NSString which represents an Image file sent from an iOS device.
The image is the signature for a credit card transaction.
I am receiving all of the data as a CFString on the Mac side.
How can I convert it to an image that I can use in FB?
This is how the data is formatted when sent with other data about the transaction.
NSData *sigData = UIImageJPEGRepresentation(delegate.signature, 1.0);
NSString *sigDataString = [NSString stringWithFormat:@"%@", sigData];
myString = [myString stringByAppendingString:@" Signature :"];
myString = [myString stringByAppendingString:sigDataString];
myString = [myString stringByAppendingString:lineFeed];
NSLog(@"%@", myString);
NSString *cardDataSend = [NSString stringWithFormat:@"%@rn", myString];
NSData *cardData = [cardDataSend dataUsingEncoding:NSUTF8StringEncoding];
[asyncSocket writeData:cardData withTimeout:-1 tag:0]; //write data to server
thanks
Steve
To unsubscribe, e-mail: fbcocoa-unsubscribe@welovegod.org For additional commands, e-mail: fbcocoa-help@freegroups.net
Click for thumbs down.0Click for thumbs up.0