Note that there are some explanatory texts on larger screens.

plurals
  1. POImage displaying only binary value
    primarykey
    data
    text
    <p>I stored images into database table through URL. After im using to fetch that image from URL. I inserted successfully. The images having URL path. But when im fetching it's displaying binary values <code>&lt;Mydata: 0x71756b0&gt;</code>. What is this?</p> <p>code:</p> <pre><code>if (sqlite3_open([path UTF8String], &amp;database) == SQLITE_OK) { NSData* data = nil; // UIImage *image = nil; // const char *sql = "SELECT product_image FROM product order by order_by"; const char *sql = "SELECT product_image FROM product"; NSLog(@"sql is %s",sql); sqlite3_stmt *statement; // int catID = 0; if (sqlite3_prepare_v2(database, sql, -1, &amp;statement, NULL) == SQLITE_OK) { // We "step" through the results - once for each row. while (sqlite3_step(statement) == SQLITE_ROW) { Mydata *Mylist = [[Mydata alloc]init]; int length = sqlite3_column_bytes(statement, 2); data = [NSData dataWithBytes:sqlite3_column_blob(statement, 2) length:length]; // UIImage *image = [UIImage imageWithData:data]; Mylist.photo = [[UIImage alloc] initWithData:data]; NSLog(@"my list is %@",Mylist); [mArray addObject:Mylist]; } } sqlite3_finalize(statement); } else { sqlite3_close(database); NSAssert1(0, @"Failed to open database with message '%s'.", sqlite3_errmsg(database)); // Additional error handling, as appropriate... } } </code></pre> <p>Image display:</p> <pre><code>int Width = 0; for (int i = 0; i&lt;[mArray count]; i++ ) { NSLog(@"index %@", mArray[i]); imgView1=[[UIButton alloc]initWithFrame:CGRectMake(20+(i*74), 0, 72, 72)]; Width = Width + 20+(i*74); [imgView1 setTag:i+1]; [imgView1 addTarget:self action:@selector(Clicked:) forControlEvents:UIControlEventTouchUpInside]; [imgView1 setImage:((Mydata *)[mArray objectAtIndex:i]).photo forState:UIControlStateNormal]; [scrollview addSubview:imgView1]; // [myScroll addSubview:imgView1]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload