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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:05:35+00:00 2026-06-05T04:05:35+00:00

For some reason, my application fails at NSAssert1(0, @Error while looping search view. ‘%s’,

  • 0

For some reason, my application fails at “NSAssert1(0, @”Error while looping search view. ‘%s'”, sqlite3_errmsg(database));”
The SQL Statement is OK, because I used the same statement, when I open the database.
I don’t get any useful errors 🙁

I’m quite new to this, but not a total stranger
What am I doing wrong ?

Please note I have taken out the “strSearch” to be sure this is not the error.

- (void)searchComponents:(NSString *)strSearch {

    NSString *qry;

    qry = [NSString stringWithFormat:@"SELECT ID, ON_SAP, SAP_PART, SAP_DESC, MOQ FROM HONEYWELL WHERE SAP_PART LIKE '%ZX%' ORDER BY SAP_PART", strSearch];
    NSLog(@"query : %@", qry);

    if(searchStmt == nil) {
        if(sqlite3_prepare_v2(database, [qry UTF8String] , -1, &searchStmt, NULL) != SQLITE_OK)
            NSAssert1(0, @"Error while creating search view statement. '%s'", sqlite3_errmsg(database));
    }

    // Loop through the results

    if(sqlite3_step(searchStmt) == SQLITE_ROW) {
        // Read the data from the result row
        NSLog(@"New row selected");
    }
    else {
        NSAssert1(0, @"Error while looping search view. '%s'", sqlite3_errmsg(database));
    }

    // Release the compiled statement from memory
    sqlite3_finalize(searchStmt);

    // Set isDetailViewHydrated as YES, so we do not get it again from the database.
    isDetailViewHydrated = YES;
}

The method is in it’s own class (named Coffee) called from MasterViewController

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
    NSLog(@"Text changed %@",searchText); 
    Coffee *coffeObj = [[Coffee alloc] init];
    [coffeObj searchComponents:@"%ZX%"];
}

The idea is to change the select statement when searching from a search field..
Does anybody know of a good example doing this ?

  • 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-06-05T04:05:37+00:00Added an answer on June 5, 2026 at 4:05 am

    Problem solved, i was missing the reset

    sqlite3_reset(searchStmt); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, the code below fails on the second line with run-time error
For some reason boost::regex overloads my application and it freezes without an error, but
For some reason on my application when running on some configuration of hard disk
for some reason I want to check how the deadlock occurred in web application
I have an application using the MySQL .Net connection but for some reason i'm
i have written an application, but for some reason it keeps peaking at 100%.
I have a Silverlight navigation application, that for some reason when showing a data
I have an Adobe AIR 3 application. For some reason, anytime I press the
I've created a flex-based application and uploaded it to vkontakte . For some reason
I've written a JavaFX application that uses Java Web Start. For some reason, the

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.