Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 06-17-2010, 07:24 AM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 2
selvamca45 is on a distinguished road
Default Crash with uncaught exception in iPad from Sqlite Statment

Hi,

I am getting problem over iPad with sqlite communication of data. Data storing, Its running good for 5 minutes then its get two type of errors.

Like,

1.Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamedundle:] was unable to load a nib named "SlideImageDisplayViewController.

2.Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to open database with message 'unable to open database file.

When i try to solve one another 1.error next time 2.error will come.


I hope some one help me.

I am attached the insertion part of my code. where i get crash.


@try{

if(insertStatment==nil){
char *sqlName = "insert into history(title,subtitle) values(?,?)";
sqlite3_stmt *insertStatment=nil;
// I am getting crash after reach the if condition
if (sqlite3_prepare_v2(database, sqlName, -1, &insertStatment, NULL) != SQLITE_OK)
{
NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
}

sqlite3_bind_text(insertStatment, 1, [title UTF8String], -1, SQLITE_TRANSIENT);
sqlite3_bind_text(insertStatment, 2, [subtitle UTF8String], -1, SQLITE_TRANSIENT);

int success11 = sqlite3_step(insertStatment);
printf("%d",success11);
sqlite3_reset(insertStatment);
if (success11 == SQLITE_ERROR)
{
NSAssert1(0, @"Error: failed to insert into the database with message '%s'.", sqlite3_errmsg(database));
}
else
{

}
}

if(insertStatment)sqlite3_finalize(insertStatment) ;
sqlite3_close(database);
NSLog(@"row inserted");
}

@catch (NSException *ex) {
@throw ex;
}
selvamca45 is offline   Reply With Quote
Old 06-17-2010, 10:13 AM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 72
F.R.E.E. is on a distinguished road
Default

Quote:
Originally Posted by selvamca45 View Post
Hi,

Code:
if(insertStatment==nil) {
    char *sqlName = "insert into history(title,subtitle) values(?,?)";
    sqlite3_stmt *insertStatment=nil;
    // I am getting crash after reach the if condition 
    if (sqlite3_prepare_v2(database, sqlName, -1, &insertStatment, NULL) != SQLITE_OK) 
    {
        NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database));
    }
}
what are you trying to do here?
F.R.E.E. is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 381
9 members and 372 guests
.Snipe, AragornSG, baja_yu, ChrisYates, davejas69, guusleijsten, hussain1982, Kryckter, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,645
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, leighec68
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:35 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0