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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:53:13+00:00 2026-05-13T09:53:13+00:00

I have a controller view who is using thoses 2 functions: [appDelegate getFichesInfo:[[self.fichesCategory idModuleFiche]

  • 0

I have a controller view who is using thoses 2 functions:


[appDelegate getFichesInfo:[[self.fichesCategory idModuleFiche] intValue] ]; //first function
self.fiche = (Fiche *)[appDelegate.fichesInfo objectAtIndex:0];


[appDelegate getFichesVisuels:[[self.fiche idFiche] intValue] ];  //second function not working
self.fiche = (Fiche *)[appDelegate.fichesInfo objectAtIndex:0];

So in my ressourceManager, here is the 2nd function in details:


- (void)getFichesVisuels:(int)value {

    fichesVisuels = [[NSMutableArray alloc] init];

    sqlite3 *database;

    if(sqlite3_open([self.databasePath UTF8String], &database) == SQLITE_OK) {
        sqlite3_reset(getFichesVisuelsStatement);


        sqlite3_bind_int(getFichesVisuelsStatement, 1,  value);

        while(sqlite3_step(getFichesVisuelsStatement) == SQLITE_ROW) {


            NSString *aTitle = [NSString stringWithUTF8String:(char *)sqlite3_column_text(getFichesVisuelsStatement , 7)];
            NSString *aLpath = [NSString stringWithUTF8String:(char *)sqlite3_column_text(getFichesVisuelsStatement , 8)];

            Visuel *visuel = [[Visuel alloc] initWithName:aTitle lpath:aLpath];

            [fichesVisuels addObject:visuel];
        }

    }
    sqlite3_close(database);
}

The problem is that the 2nd function is not working (librairies routine called out of sequence) because I am already calling the 1st function in the same way (I wanna be able to execute many query using arguments in the same times). I heard that using NSInvocation can be the solution to this problem, but I don’t know how to turn my code using NSInvocation.
Someone can help me?

Best Regards,

  • 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-13T09:53:13+00:00Added an answer on May 13, 2026 at 9:53 am

    The problem you could be having is that your prepared statement is invalid after sqlite3_close. You need to create a new prepared statement each time you open the database.

    1. Open the database with sqlite3_open.
    2. Prepare the statement with sqlite3_prepare and friends.
    3. Bind with sqlite3_bind.
    4. Step with sqlite3_step.
    5. Afterwards, ensure you call sqlite3_finalize.
    6. Close the database with sqlite3_close.

    You can’t just reset the statement, because that statement was prepared for a different database handle.

    NB

    I’m not too familiar with SQLite.

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

Sidebar

Related Questions

I have a view controller who's views are loaded from a nib file. The
I have view controller, into the view i have put a table view, and
I have two view controller classes in my application delegate. I can change from
I have a view controller and I am intercepting the touches on links within
I have a view controller class that has to implement several protocols. Too keep
I have a view controller that gets presented modally and changes some data that
Example: I have a view controller and get rid of it. But there's still
Is it a leak if I have a view controller and allocate the view
I have a UIScrollView in my project. I have a view controller I would
When submitting one form from view, how can i also read or have controller

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.