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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:03:19+00:00 2026-05-23T11:03:19+00:00

I have no idea what was the problem is in my program. When run

  • 0

I have no idea what was the problem is in my program. When run this select code for fetching data from SQlite in my program, the first time it crashes with this error message:

kill error while killing target (killing anyway):
warning: error on line 2179 of “/SourceCache/gdb/gdb-1510/src/gdb/macosx/macosx-nat-inferior.c” in function “macosx_kill_inferior_safe”: (os/kern) failure (0x5x)
quit

Here’s my insert code:

-(id)init {
    self = [super init];

    sqlite3 *database;

    NSMutableArray *locations;
    NSString *result = nil;
    NSString *dbPath = [self getWritableDBPath];

    if(sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) 
    {
        NSString *sqlStr = [NSString stringWithFormat:@"select Longitude,Latitude from myLocation"];
        const char *sqlStatement = [sqlStr UTF8String];
        sqlite3_stmt *compiledStatement;

        if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
            locations = [NSMutableArray array];

            while(sqlite3_step(compiledStatement) == SQLITE_ROW) {

                double longitude = sqlite3_column_double(compiledStatement, 0);
                double latitude = sqlite3_column_double(compiledStatement, 1);
                NSLog(@"%f , %f",longitude,latitude);
                NSString *coords = [[[NSString alloc] initWithFormat:@"%f,%f\n",longitude,latitude] autorelease];

                [locations addObject:coords];
                NSLog(@"this location :-%@",locations);
                //[coords release];

            }

            result = [locations componentsJoinedByString:@","]; // same as `fake_location`
            NSLog(@"this for resulte data :- %@",result);
            // Get file path here

            NSError *error;
            if ( [result writeToFile:dbPath atomically:YES encoding:NSUTF8StringEncoding error:&error] ) {
                NSLog(@"%@", [error localizedDescription]);
            }
        }
        // Release the compiled statement from memory
        sqlite3_finalize(compiledStatement);
    }
    sqlite3_close(database);


    pointsArray = [[result componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] retain];
    pointsArrayIndex = 0;
    oldLocationsIndex = 0;

    [result release];

    oldLocations = [[NSMutableArray alloc] init];


    return self;
}

The second time I run my application, it shows me that on the console:

Save Error: file is encrypted or is not a database

What do these errors mean, and how do I solve that?

  • 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-23T11:03:20+00:00Added an answer on May 23, 2026 at 11:03 am

    You need to fire insert query using following:

    -(void)insertLocation:(double)latitude withLongitude:(double)longitude
    {
    sqlite3_stmt *insertStatement = nil;
    const char *sql = "insert into UserJourneyLocation(Latitude, Longitude) Values(?,?)";
    int returnValue = sqlite3_prepare_v2(database, sql, -1, &insertStatement, NULL);
    if(returnValue == SQLITE_OK)
    {
        sqlite3_bind_double(insertStatement,1,latitude);
                sqlite3_bind_double(insertStatement,2,longitude);
        if(sqlite3_step(insertStatement)==SQLITE_DONE)
        {
            //Data;
        }
    }
    sqlite3_finalize(insertStatement);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an idea for how to solve this problem, but I wanted to
I have this idea for a free backup application. The largest problem I need
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
I can't understand this... Cannot get this code to run and I've no idea
I have a weird problem with aRuby program I'm writing. Basically the idea is
I have a C++ program that crashes on an access violation when I run
I have no idea how to describe my problem. It is the simplest way
I have come to a problem, wich I have no idea how to solve.
a possibly simple problem, but weird why I have no idea how to do
I am using ajaxForm. Now I have encountered a problem. My idea is when

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.