Data obtained from blob field in database
ringa_lee
ringa_lee 2017-05-16 13:19:31
0
2
1102

The data obtained from the blob field in the database is data,

{7920b7e8 1743de9c afdd9cd9 90ccf3d3 79d916ec 69d80278 72fd3495 cdb4e19c 0f813a57 dded5db4 f1907cd7 996d14be 9d090f3d b4ce1020 142ab0 b8 1e571111 6f02f840 1935403a 13369916 c470692f cfea04c6 eb269dba 5a647911 cdfc9553 9da0942d 6bdbe4e2 e4dca09d 13f7ec98 e7e9fe76 d11697f3 70d5a2ab 80b65839 c180d964 5b0c3d28 e0684c4e 11e92f37 5f9ed5b9 a829cd60 ea19323f bafadd50 e61488e7 f8a76df1 c4c1e293 0dc3e8e6 99a6f9ae 3b 28d755 f795de49 3b8c3b04 9dd4b96c 4453ad73 8f6988fa 6ac0f5c0 23c4855b 1414305d bfc28999 a584f5e1 7f307669 6b1b6857 d11f3081 22a061a7 9188 ff0b 0406a581 732d7894 ecd032dc 19518a90 ecd58d16 d8b5df98 2d007730 ee4c3c37 1adb1e1b fd4b8002 0a0dd947 1f13510c d29bd613 fe7c6759 50 0fe771 d53fb4f5 5ea0853e 0ff2794b 919d0a9f 9708dd44 e824de1c 07fbe90d a3708ea4 00fb7de5 8e43771a ba5c1c28 d967b944 69e740c9 92dad582 bb73 9644 09c30799 7113bda5 4a567dfa 6e059fc0 1d245d9a 6428bbfe d9b18052 ff93d1f7 c4ab8c45 6c8e066f c96f6ee4 b0291d5a 7a3d7cbc b009b399 160ca577 a0fce016 3d87006f 67b4ea1d 8a9e6c06 9d5ae2cd 2 b786a2e a08bf8d4 9ba25b3e ee28fdc7 35333a9d 447b35d7 0774777a 1aa26d21 c36d64ef ea42569f 64c9eb61 5d625987 cf4c9387 00}

I use NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; the result is empty, I don’t know what’s going on, please help.

ringa_lee
ringa_lee

ringa_lee

reply all(2)
滿天的星座

What is your blob data source, that is, what is your data converted into, pictures? String? The data in whatever format is converted directly into whatever data it is. If it is not a string in the first place, it definitely cannot be converted into a string.

伊谢尔伦

根据这个:

sqlite3 insert and read BLOB data in database

int len = sqlite3_column_bytes(statement, 0);
NSData *data = [[NSData alloc] initWithBytes: sqlite3_column_blob(statement, 0) length: len];
NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

How to retrieve string from NSData stored in sqlite?

const void *bytes = sqlite3_column_blob(statement, 6);
int length = sqlite3_column_bytes(statement, 6);
NSData *myData = [[NSData alloc] initWithBytes:bytes length:length];
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template