Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7090573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:04:17+00:00 2026-05-28T08:04:17+00:00

I connected Sqlite3 to my project to UITableview the code went fine But when

  • 0

I connected Sqlite3 to my project to UITableview the code went fine But when i open the table in simulator instead of data it is showing something like <db: 0x8a35e20>.
Can anyone let me know what went wrong !

Please find my code of table below:

#import "table1.h"
#import "db.h"

@implementation table1
@synthesize tableOne;

#pragma mark - View lifecycle
- (void)viewDidLoad
{

    databaseName=@"nobel10.db";

    NSArray *documentPaths= NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString * documentDir = [documentPaths objectAtIndex:0];
    databasePath=[documentDir stringByAppendingPathComponent:databaseName];
    [self checkAndCreateDatabase];
    [self readDataFromDatabase];
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}


#pragma mark - TableView Data Source methods
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [tableOne count]; }

// Row display. Implementers should *always* try to reuse cells by setting each cell's reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier:
// Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls)

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell= nil;
    cell = [tableView dequeueReusableCellWithIdentifier:@"mycell"];
    if (cell == nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"mycell"];}
    cell.textLabel.text =[NSString stringWithFormat:@"%@" ,[tableOne objectAtIndex:indexPath.row]];
    return  cell;}
-(void)checkAndCreateDatabase{
    BOOL success;
    NSFileManager *fileManager=[NSFileManager defaultManager];
    success=[fileManager fileExistsAtPath:databasePath];
    if(success)
        return;

    NSString *databasePathFromApp = [[[NSBundle mainBundle]resourcePath] stringByAppendingPathComponent:databaseName];
    [fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil];
    [fileManager release];
}
-(void)readDataFromDatabase{
    sqlite3 *database;
    tableOne=[[NSMutableArray alloc]init];
    if(sqlite3_open([databasePath UTF8String], &database)== SQLITE_OK){
    const char *sqlStatement = "SELECT * FROM gender";
        sqlite3_stmt *compiledStatement;
        if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL)==SQLITE_OK){
            while (sqlite3_step(compiledStatement)==SQLITE_ROW) {
                NSString *stringName=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];

                db *info =[[db alloc]initWithName:stringName];
                [tableOne addObject:info];
                [info release];
            }

        }
         sqlite3_finalize(compiledStatement);
    }
    sqlite3_close(database);
}
- (void)dealloc
{

    [tableOne release];
    [super dealloc];
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:04:18+00:00Added an answer on May 28, 2026 at 8:04 am

    You are directly setting the db object to the tableview’s label.You may need to set the db object’s instance variables value to the label as follows

    cell.textLabel.text =[NSString stringWithFormat:@"%@" ,[(db*)[tableOne objectAtIndex:indexPath.row]name]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is connected to BI and merging of data from different data sources and
I've connected to database, using data set .xsr now I wan't to extract all
I'm using Python 2.6.4 and its module sqlite3 for a small database project and
Sqlite3 database is not connected in iPhone 4 running iOS 5.0.1, on both Wi-Fi
I have published my web project to local iis but framework can't find the
I've installed the System.Data.SQLite ADO.NET Provider from http://sqlite.phxsoftware.com/ . I can connect to the
I have connected to a server via SFTP using FileZilla and accepted adding the
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
I have two keyboards connected to my PC, is there any way to know
I've connected to a MySQL database using Perl DBI. I would like to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.