Development experience.
The first is to obtain images from the network and read the images from the network in the form of nsdata to the localCodeIt's easy. There are only two sentences.
Nsstring * url = @ "http://www.163.com/a.jpg"; nsdata * imagedata = [[nsdata alloc] initwithcontentsofurl: [nsurl urlwithstring: url];
The second is to save the image to SQLite and bind the Blob type to the query.
Sqlite3_bind_blob (stmt, 7, [Image bytes], [Image length], null );
After the data is saved, you can add the SELECT statement to the nsdictionary directly if needed. We will not discuss how to return data here.
Const void * op = sqlite3_column_blob (statement, 10); int size = sqlite3_column_bytes (statement, 10); nsdata * Data = [[nsdata alloc] initwithbytes: op length: Size];
After saving the file, nsdata is returned. How can I display it on the foreground? Simpler
nsdata * Data = data; // nsdata * imagedata = [[nsdata alloc] initwithbytes: [data bytes] length: [Data Length] obtained from select; uiimage * image = [[uiimage alloc] initwithdata: imagedata]; [profileimage setimage: Image];