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 7418785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:56:51+00:00 2026-05-29T07:56:51+00:00

I use sqlite for my simple iOS app. The problem is that I can’t

  • 0

I use sqlite for my simple iOS app. The problem is that I can’t get the result from the query. I will skip the code which is responsible for opening the database. It works.

NSString *query = @"SELECT * FROM tickets LIMIT 0,1";

if(sqlite3_prepare_v2(database, [query UTF8String], -1, &statement, nil) == SQLITE_OK)
    {
    NSString *strResult = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 1)]; 
            NSLog(@"%@", strResult);
            sqlite3_finalize(statement);
    }    

Here the app crash with a message:

NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString'

I’m 100% sure that the query

SELECT * FROM tickets LIMIT 0,1

return result which is not NULL. I have tested the query above with sqlite client and it works fine.

What is wrong here ?

  • 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-29T07:56:51+00:00Added an answer on May 29, 2026 at 7:56 am

    You didn’t evaluate your statement. You should use:

    int sqlite3_step(sqlite3_stmt*);
    

    after sqlite3_prepare_v2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a simple application to use sqlite, the problem is that the following
I'm wondering whether to use CoreData or simple sqlite database for an iOS app.
I'd sort of like to use SQLite from within C#.Net, but I can't seem
My app uses a simple SQLite database. Everything works fine I can now present
I am query my sqlite data base for my Android app. I then use
I need to convert an app from sqlite to Postgresql in order to use
I want to use SQLite within my MFC application. for that, i'll create an
What components can I use to use SQlite database with Delphi 6?
Would be great to get some direction re trying to use sqlite for my
I want to get start with DayPilot control I do not use SQLite and

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.