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

Reply
 
LinkBack Thread Tools Display Modes
Old 08-16-2011, 03:51 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 84
prathibha is on a distinguished road
Thumbs up library routine called out of sequence'

Hi,
I am using the following code to store the datas into database

-(void)saveGimAccountListArrayNSArray*)GA1
{


for(int i = 0; i< [GA1 count];i++)
{
// NSString* a= [[NSString alloc]initWithData:[accountList objectAtIndex:i] encoding:NSASCIIStringEncoding];

NSLog(@"alias is %@",[(GIMAccount*)[GA1 objectAtIndex:i]alias]);
NSLog(@"id is %i",[(GIMAccount*)[GA1 objectAtIndex:i]ID]);


}

if(sqlite3_open([[self filepath] UTF8String], &db) == SQLITE_OK)
{

addStmt = nil;//check either it should be inside or outside once if problem comes
for (int i = 0; i < [GA1 count]; i++) {

if(addStmt == nil) {
const char *sql = "insert into GIMAccount(accAlias,bankId) Values(?, ?)";
if(sqlite3_prepare_v2(db, sql, -1, &addStmt, NULL) != SQLITE_OK)
NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(db));
}

sqlite3_bind_text(addStmt, 1,[[(GIMAccount*)[GA1 objectAtIndex:i]alias]UTF8String], -1, SQLITE_TRANSIENT);
sqlite3_bind_int(addStmt, 2,[(GIMAccount*)[GA1 objectAtIndex:i]ID]);




if(SQLITE_DONE != sqlite3_step(addStmt))
NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(db));
else
NSLog(@"sqlite last insert");

sqlite3_finalize(addStmt);
sqlite3_reset(addStmt);// crashing here for the last time for for loop telling " library routine called out of sequence'"


}

}

}

Please can u tell me y it is crashing ? please ii am realy in trouble.

Last edited by prathibha; 12-06-2011 at 06:44 AM. Reason: i need a answer.
prathibha is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, objective c

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: 394
13 members and 381 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, fiftysixty, gmarro, jimmyon122, jonathandeknudt, pungs, raymng, stanny, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

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