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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:52:28+00:00 2026-06-04T22:52:28+00:00

I am preparing my app to be iOS 4 compatible and got the issue,

  • 0

I am preparing my app to be iOS 4 compatible and got the issue, that for some weird reason, enabling the 0 index of my segmentedControl causes the code to call the openDatabase method and closeDatabase method. I have been debugging the entire code, and figured out, that as soon as the segmentedControl is enabled, those two methods are called.

Here the excerpt of the log:

> 2012-04-17 17:20:59.294 Abiliator[27897:11003] viewWillAppear - before database open
2012-04-17 17:20:59.296 Abiliator[27897:11003] OpenDatabase
2012-04-17 17:20:59.297 Abiliator[27897:11003] viewWillAppear - loadAppSettings
2012-04-17 17:20:59.311 Abiliator[27897:11003] viewWillAppear - getCurrentLearningSubject
2012-04-17 17:20:59.340 Abiliator[27897:11003] viewWillAppear - switchLearningBoxControl
2012-04-17 17:20:59.341 Abiliator[27897:11003] Inside switchLearningBoxControl
**2012-04-17 17:20:59.394 Abiliator[27897:11003] OpenDatabase
2012-04-17 17:21:00.566 Abiliator[27897:11003] CloseDatabase**
2012-04-17 17:21:00.567 Abiliator[27897:11003] Method abiliatorViewController - Function switchLearningBoxControl: Error preparing the statement 'library routine called out of sequence'.
2012-04-17 17:21:00.568 Abiliator[27897:11003] Method abiliatorViewController - Function switchLearningBoxControl: Error preparing the statement 'library routine called out of sequence'.
2012-04-17 17:21:00.569 Abiliator[27897:11003] Method abiliatorViewController - Function switchLearningBoxControl: Error preparing the statement 'library routine called out of sequence'.
2012-04-17 17:21:00.570 Abiliator[27897:11003] Method abiliatorViewController - Function switchLearningBoxControl: Error preparing the statement 'library routine called out of sequence'.
2012-04-17 17:21:00.570 Abiliator[27897:11003] Finished switchLearningBoxControl
2012-04-17 17:21:00.571 Abiliator[27897:11003] viewWillAppear - getQuestionFromDB
2012-04-17 17:21:00.572 Abiliator[27897:11003] CloseDatabase
2012-04-17 17:21:00.572 Abiliator[27897:11003] Failed to close the database with message 'library routine called out of sequence'.

You see two subsequent open and close database method calls. However those are not explicitly called by my code, but some “ghost” process is executing that part of the code.

The very same code runs on iOS 5 just fine, no issues at all, neither in Simulator nor on the device.

Any idea, what the issue might be? Thanks.

- (void) switchLearningBoxControl:(NSString *) mySubjectID {
const char *sql = "select count (*) from ABILIATOR_CARD where learningbox = ? and subject_id = ?";
for (NSInteger mySegment=0;mySegment < 5;mySegment++) {
    sqlite3_stmt *selectstmt;

    if(sqlite3_prepare_v2(database, sql, -1, &selectstmt, NULL) == SQLITE_OK) {
        sqlite3_bind_int(selectstmt, 1, mySegment+1);
        sqlite3_bind_text(selectstmt, 2, [mySubjectID UTF8String], -1, SQLITE_TRANSIENT);
        if (sqlite3_step(selectstmt) == SQLITE_ROW) {
            int count = sqlite3_column_int(selectstmt, 0);
            if (count < 1) {
                [self.learningBoxControl setEnabled:NO forSegmentAtIndex:mySegment];
            }
            else {
                [self.learningBoxControl setEnabled:YES forSegmentAtIndex:mySegment];
            }
        }
        else {
            [self.learningBoxControl setEnabled:NO forSegmentAtIndex:mySegment];
        }

    }
    else {
        NSLog(@"Method abiliatorViewController - Function switchLearningBoxControl: Error preparing the statement '%s'.", sqlite3_errmsg(database));
    }
    sqlite3_finalize(selectstmt);   
}
}
  • 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-04T22:52:29+00:00Added an answer on June 4, 2026 at 10:52 pm

    in iOS 4 setEnabled calls the IBAction, iOS 5 does not. I have another open in that IBAction, which of course confuses the app 🙂 Was not aware of that change, as I have read the doc and did no see any such change between 4 and 5.

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

Sidebar

Related Questions

I have been working on a Core Data iOS app that works perfectly through
I'm studying some systems that allow faster App dev cycles. So I stumbled upon
I'm preparing to develop some mobile apps for Android, iOS and WP7. Having heard
I'm preparing to embark on a web app development that will make little to
I am preparing to develop a mapping app that places semi-transparent tiled images over
We are preparing to deploy a Windows .NET client app that will make web
I'm preparing to deploy my Django app and I noticed that when I change
I'm preparing to deploy a Rails app on Heroku that requires full text search.
I am preparing a Blackberry app in which I prepare an HTTP connection and
In preparing to a OOP exam, I enjoyed seeing g++ compile the following code

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.