What you need to start to use this is :
- NSDataAddictions that you can find easily on google.
Is a special NSDataAddictions with MD5 and BASE64 encoding for this purpose.
Insert the .h and .m files into your project and #import it in the UntitledViewController (as i use 1 View for all, or in the View you need it).
- Function getStringFromWChar
PHP:
//Code to save the image when arrive to server
// Take what you receive in UTF8 from the POST and...
$new_image = chunk_split(base64_encode($my_image));
$query = "INSERT INTO my_table (Image) VALUES ('$my_image')";
mysql_query($query);
//Remember to define LONGBLOB (or what you need) the column my_table
//Code to retrieve image from the server
//Query the MySQL to retrieve what you saved before and send as answer under JSON if is an array or in normal if 1 data
$ANSWER = json_encode($my_datas);
$ANSWER = $my_datas;
//Here is your choice to choose to echo or use the AGK... hmmm i don't know, but i think you already done some test with normal text
OBJ C++
//Creating the image from data
//Imagine you get XML or JSON UTF8 data from the request (REQUEST_RESULT)
//If you don't need JSON or XML you can manage the data as they arrive
NSData *_temp_image = [NSData dataWithBase64EncodedString:[NSString stringWithUTF8String: getStringFromWChar(JSON::decode(REQUEST_RESULT)]];
//You need a JSON parser (as i done my own one, cause the Apple one is not very good)
UIImage *_im = [UIImage imageWithData:_temp_image];
I hope this can help!
iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic